getList($this->request->param()); return $this->renderSuccess(compact('list')); } /** * 常规发货/拆分发货 * @param int $user_rice_delivery_id 配送ID * @return array * @throws \Exception * @author: zjwhust * @Time: 2022/1/14 19:24 */ public function delivery(int $user_rice_delivery_id){ $model = UserRiceDeliveryModel::find($user_rice_delivery_id); if ($model->delivery($this->request->param())) { return $this->renderSuccess('确认发货成功'); } return $this->renderError($model->getError()); } /** * 修改订单收货信息 * @param int $user_rice_delivery_id 配送ID * @return array * @author: zjwhust * @Time: 2022/1/14 19:24 */ public function updAddress(int $user_rice_delivery_id){ $model = UserRiceDeliveryModel::find($user_rice_delivery_id); if ($model->updAddress($this->request->param())) { return $this->renderSuccess('修改收货地址成功'); } return $this->renderError($model->getError()); } /** * 查看物流详情 * @param string $express_no * @return array * @throws BaseException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author: zjwhust * @Time: 2022/1/14 19:24 */ public function express(string $express_no) { $model = new UserRiceDeliveryExpressModel(); $detail = $model->where('express_no',$express_no)->find(); if (!$detail || $detail['delivery_status']!=DeliveryStatusEnum::DELIVERED) { return $this->renderError('未发货'); } $res['order'] = [ "express_no" => $detail['express_no'], "express_company" => $detail['express_company'], ]; // $res['address'] = UserRiceDeliveryModel::find($detail['user_rice_delivery_id']); $res['delivery'] = (new ExpressModel)->deliverylist($express_no, $detail['delivery_time'], 1); return $this->renderSuccess(compact('res')); } /** * 获取拆分包裹的物流列表 * @param int $UserRiceDeliveryId * @return UserRiceDeliveryExpressModel[]|array|\think\Collection * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author: zjwhust * @Time: 2022/1/15 11:47 */ public function expressList(int $user_rice_delivery_id){ $list = UserRiceDeliveryExpressModel::where('user_rice_delivery_id',$user_rice_delivery_id)->select(); return $this->renderSuccess(compact('list')); } }