Delivery.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types=1);
  12. namespace app\api\model\order;
  13. use app\common\model\order\Delivery as DeliveryModel;
  14. /**
  15. * 订单发货单模型
  16. * Class Delivery
  17. * @package app\api\model\order
  18. */
  19. class Delivery extends DeliveryModel
  20. {
  21. // 隐藏的字段
  22. protected $hidden = [
  23. 'eorder_html',
  24. 'store_id',
  25. 'create_time',
  26. ];
  27. /**
  28. * 获取指定订单的发货单记录
  29. * @param int $orderId
  30. * @return Delivery[]|array|\think\Collection
  31. * @throws \think\db\exception\DataNotFoundException
  32. * @throws \think\db\exception\DbException
  33. * @throws \think\db\exception\ModelNotFoundException
  34. */
  35. public function getList(int $orderId)
  36. {
  37. return $this->with(['express', 'goods.goods.image'])
  38. ->where('order_id', '=', $orderId)
  39. ->select();
  40. }
  41. }