StoreIntegralOrderStatusServices.php 1.9 KB

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