From 6084700454cdc8eda05cd208562b25704e5f1997 Mon Sep 17 00:00:00 2001 From: weiz Date: Wed, 8 Nov 2023 15:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=89=A9=E6=B5=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=AF=B9=E5=A4=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/controller/LogisticController.php | 74 ++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/app/common/controller/LogisticController.php b/app/common/controller/LogisticController.php index 3565c060..0a45087d 100644 --- a/app/common/controller/LogisticController.php +++ b/app/common/controller/LogisticController.php @@ -1,6 +1,7 @@ success('请求成功',$logistics->toArray()); } + + /* + * 获取配送员物流信息列表 + * @method get + * @param int $courier_id 配送员id + * @param int $status 物流状态 + * @param int $page_size 每页数量 + * @param int $page_num 页码 + * @return \think\response\Json + */ + public function courierLogisticsList(): \think\response\Json + { + //获取参数 + $params = $this->request->post(['user_id','user_type','status','page_size','page_num','keywords']); + //验证参数 + if(empty($params['user_id'])) return $this->fail('参数错误'); + if(!isset($params['user_type'])) return $this->fail('参数错误'); + if(empty($params['keywords'])) $params['keywords'] = ''; + //返回数据 + return $this->data(LogisticsLogic::list($params)); + } + + /* + * 获取物流信息详情 + * @method get + * @param int $logistics_id 物流id + * @return \think\response\Json + */ + public function courierLogisticsDetail(): \think\response\Json + { + //获取参数 + $logistics_id = $this->request->post('logistics_id'); + //验证参数 + if(empty($logistics_id)) return $this->fail('参数错误'); + //返回数据 + return $this->data(LogisticsLogic::cDetail($logistics_id)); + } + + /* + * 配送员提取商品 + * @method post + * @param int $logistics_id 物流id + * @return \think\response\Json + */ + public function courierTakeGoods(): \think\response\Json + { + //获取参数 + $params = $this->request->post(['logistics_id','order_id','order_sn']); + //验证参数 + if(empty($params['logistics_id']) || empty($params['order_id']) || empty($params['order_sn'])) return $this->fail('参数错误'); + //提取商品 + $result = LogisticsLogic::takeGoods($params); + //返回数据 + return $result['code'] ==1 ? $this->success('提取成功') : $this->fail($result['msg']); + } + + /* + * 配送员完成配送 + * @method post + * @param int $logistics_id 物流id + * @return \think\response\Json + */ + public function courierCompleteDelivery(): \think\response\Json + { + //获取参数 + $params = $this->request->post(['logistics_id','take_code']); + //验证参数 + if(empty($params['logistics_id']) || empty($params['take_code'])) return $this->fail('参数错误'); + //完成配送 + $result = LogisticsLogic::doneDelivery($params); + //返回数据 + return $result['code'] ==1 ? $this->success('配送完成') : $this->fail($result['msg']); + } } \ No newline at end of file