// +---------------------------------------------------------------------- namespace app\controller\admin\v1\supplier; use app\services\order\StoreOrderDeliveryServices; use think\facade\App; use app\controller\admin\AuthController; use app\services\order\StoreOrderServices; use app\common\controller\Order as CommonOrder; use app\services\order\supplier\SupplierOrderServices; /** * Class StoreOrder * @package app\controller\admin\v1\supplier */ class StoreOrder extends AuthController { use CommonOrder; /** * @var StoreOrderServices */ protected $services; /** * StoreOrder constructor. * @param App $app * @param StoreOrderServices $services */ public function __construct(App $app, StoreOrderServices $services) { parent::__construct($app); $this->services = $services; } /** * 订单列表 * @return mixed * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function index() { $where = $this->request->getMore([ ['status', ''], ['real_name', ''], ['is_del', ''], ['data', '', '', 'time'], ['type', ''], ['pay_type', ''], ['order', ''], ['field_key', ''], ['supplier_id', -1] ]); if ($where['supplier_id'] < 1) { $where['supplier_id'] = -1; } $where['type'] = trim($where['type']); $where['is_system_del'] = 0; $where['store_id'] = 0; $where['type'] = trim($where['type'], ' '); return $this->success($this->services->getOrderList($where, ['*'], ['split' => function ($query) { $query->field('id,pid'); }, 'pink', 'invoice', 'supplier'])); } /** * 提醒发货 * @param StoreOrderDeliveryServices $storeOrderDeliveryServices * @param $supplierId * @param $id * @return mixed * @throws \Psr\SimpleCache\InvalidArgumentException */ public function deliverRemind(StoreOrderDeliveryServices $storeOrderDeliveryServices, $supplierId, $id) { if (!$supplierId || !$id) return $this->fail('参数异常'); $storeOrderDeliveryServices->deliverRemind((int)$id); return $this->success('提醒成功'); } }