StoreIntegralOrderStatusServices.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2022 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\activity\integral;
  12. use app\dao\activity\integral\StoreIntegralOrderStatusDao;
  13. use app\services\BaseServices;
  14. use crmeb\traits\ServicesTrait;
  15. /**
  16. * 订单状态
  17. * Class StoreOrderStatusServices
  18. * @package app\services\order
  19. */
  20. class StoreIntegralOrderStatusServices extends BaseServices
  21. {
  22. use ServicesTrait;
  23. /**
  24. * 构造方法
  25. * StoreIntegralOrderStatusServices constructor.
  26. * @param StoreIntegralOrderStatusDao $dao
  27. */
  28. public function __construct(StoreIntegralOrderStatusDao $dao)
  29. {
  30. $this->dao = $dao;
  31. }
  32. /**
  33. * 订单状态分页
  34. * @param array $where
  35. * @return array
  36. * @throws \think\db\exception\DataNotFoundException
  37. * @throws \think\db\exception\DbException
  38. * @throws \think\db\exception\ModelNotFoundException
  39. */
  40. public function getStatusList(array $where)
  41. {
  42. [$page, $limit] = $this->getPageValue();
  43. $list = $this->dao->getStatusList($where, $page, $limit);
  44. foreach ($list as &$item) {
  45. if (is_int($item['change_time'])) $item['change_time'] = date('Y-m-d H:i:s', $item['change_time']);
  46. }
  47. $count = $this->dao->count($where);
  48. return compact('list', 'count');
  49. }
  50. }