You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

StoreOrderStatusServices.php 1.2KB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\services\order;
  3. use app\dao\order\StoreOrderStatusDao;
  4. use app\services\BaseServices;
  5. use crmeb\traits\ServicesTrait;
  6. /**
  7. * 订单状态
  8. * Class StoreOrderStatusServices
  9. * @package app\services\order
  10. */
  11. class StoreOrderStatusServices extends BaseServices
  12. {
  13. use ServicesTrait;
  14. /**
  15. * 构造方法
  16. * StoreOrderStatusServices constructor.
  17. * @param StoreOrderStatusDao $dao
  18. */
  19. public function __construct(StoreOrderStatusDao $dao)
  20. {
  21. $this->dao = $dao;
  22. }
  23. /**
  24. * 订单状态分页
  25. * @param array $where
  26. * @return array
  27. * @throws \think\db\exception\DataNotFoundException
  28. * @throws \think\db\exception\DbException
  29. * @throws \think\db\exception\ModelNotFoundException
  30. */
  31. public function getStatusList(array $where)
  32. {
  33. [$page, $limit] = $this->getPageValue();
  34. $list = $this->dao->getStatusList($where, $page, $limit);
  35. foreach ($list as &$item) {
  36. if (is_int($item['change_time'])) $item['change_time'] = date('Y-m-d H:i:s', $item['change_time']);
  37. }
  38. $count = $this->dao->count($where);
  39. return compact('list', 'count');
  40. }
  41. }