StoreDeliveryOrderDao.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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\dao\order;
  12. use app\dao\BaseDao;
  13. use app\model\order\StoreDeliveryOrder;
  14. /**
  15. * 发货订单
  16. * Class StoreDeliveryOrderDao
  17. * @package app\dao\order
  18. */
  19. class StoreDeliveryOrderDao extends BaseDao
  20. {
  21. /**
  22. * @return string
  23. */
  24. protected function setModel(): string
  25. {
  26. return StoreDeliveryOrder::class;
  27. }
  28. /**
  29. * 获取列表
  30. * @param array $where
  31. * @param string $field
  32. * @param int $page
  33. * @param int $limit
  34. * @param array $with
  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 getList(array $where, string $field = '*', int $page = 0, int $limit = 0, array $with = [])
  41. {
  42. return $this->search($where)->field($field)->when($with, function($query) use ($with) {
  43. $query->with($with);
  44. })->when($page && $limit, function($query) use ($page, $limit) {
  45. $query->page($page, $limit);
  46. })->order('id desc')->select()->toArray();
  47. }
  48. }