StoreOrderStatusServices.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\services\order;
  12. use app\dao\order\StoreOrderStatusDao;
  13. use app\services\BaseServices;
  14. /**
  15. * 订单状态
  16. * Class StoreOrderStatusServices
  17. * @package app\services\order
  18. */
  19. class StoreOrderStatusServices extends BaseServices
  20. {
  21. /**
  22. * 构造方法
  23. * StoreOrderStatusServices constructor.
  24. * @param StoreOrderStatusDao $dao
  25. */
  26. public function __construct(StoreOrderStatusDao $dao)
  27. {
  28. $this->dao = $dao;
  29. }
  30. /**
  31. * 订单状态分页
  32. * @param array $where
  33. * @return array
  34. * @throws \think\db\exception\DataNotFoundException
  35. * @throws \think\db\exception\DbException
  36. * @throws \think\db\exception\ModelNotFoundException
  37. */
  38. public function getStatusList(array $where)
  39. {
  40. [$page, $limit] = $this->getPageValue();
  41. $list = $this->dao->getStatusList($where, $page, $limit);
  42. foreach ($list as &$item) {
  43. if (is_int($item['change_time'])) $item['change_time'] = date('Y-m-d H:i:s', $item['change_time']);
  44. }
  45. $count = $this->dao->count($where);
  46. return compact('list', 'count');
  47. }
  48. }