From cf88ae3699f66513ffa28e998f9b360573a144a6 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Wed, 9 Aug 2023 15:26:33 +0800 Subject: [PATCH] dd --- app/api/controller/LogisticsController.php | 8 ++++---- app/api/logic/LogisticsLogic.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/api/controller/LogisticsController.php b/app/api/controller/LogisticsController.php index 0820b945..dc794594 100755 --- a/app/api/controller/LogisticsController.php +++ b/app/api/controller/LogisticsController.php @@ -127,9 +127,9 @@ class LogisticsController extends BaseApiController public function userConfirmReceipt(): \think\response\Json { //获取参数 - $params = $this->request->post(['logistics_id','user_id']); + $params = $this->request->post(['order_id','order_sn']); //验证参数 - if(empty($params['logistics_id']) || empty($params['user_id'])) return $this->fail('参数错误'); + if(empty($params['order_id']) || empty($params['order_sn'])) return $this->fail('参数错误'); //完成配送 $result = LogisticsLogic::receipt($params); //返回数据 @@ -145,9 +145,9 @@ class LogisticsController extends BaseApiController public function userCancelOrder(): \think\response\Json { //获取参数 - $params = $this->request->post(['logistics_id','user_id']); + $params = $this->request->post(['order_id','order_sn']); //验证参数 - if(empty($params['logistics_id']) || empty($params['user_id'])) return $this->fail('参数错误'); + if(empty($params['order_id']) || empty($params['order_sn'])) return $this->fail('参数错误'); //完成配送 $result = LogisticsLogic::cancel($params); //返回数据 diff --git a/app/api/logic/LogisticsLogic.php b/app/api/logic/LogisticsLogic.php index 12dd0a2d..d869ed22 100644 --- a/app/api/logic/LogisticsLogic.php +++ b/app/api/logic/LogisticsLogic.php @@ -235,7 +235,7 @@ class LogisticsLogic extends BaseLogic */ public static function receipt($params):array { //获取物流信息 - $logistics = Logistics::where('id', $params['logistics_id'])->where('user_id',$params['user_id'])->find(); + $logistics = Logistics::where('order_id', $params['order_id'])->where('order_sn',$params['order_sn'])->find(); if (!$logistics) return ['code'=>0, 'msg'=>'物流信息不存在']; if ($logistics['status'] == 4) return ['code'=>0, 'msg'=>'状态不可更改']; //设置记录信息 @@ -248,7 +248,7 @@ class LogisticsLogic extends BaseLogic 'create_time' => time(), ]; //更改物流信息状态 - $res = self::status($params['logistics_id'], 3,$record); + $res = self::status($logistics['id'], 3,$record); if($res){ return ['code'=>1, 'msg'=>'操作成功']; }else{ @@ -263,9 +263,9 @@ class LogisticsLogic extends BaseLogic */ public static function cancel($params):array { //获取物流信息 - $logistics = Logistics::where('id', $params['logistics_id'])->where('user_id',$params['user_id'])->find(); + $logistics = Logistics::where('order_id', $params['order_id'])->where('order_sn',$params['order_sn'])->find(); if (!$logistics) return ['code'=>0, 'msg'=>'物流信息不存在']; - if ($logistics['status'] == 2 || $logistics['status'] == 3 || $logistics['status'] == 4) return ['code'=>0, 'msg'=>'状态不可更改'];;; + if ($logistics['status'] == 2 || $logistics['status'] == 3 || $logistics['status'] == 4) return ['code'=>0, 'msg'=>'状态不可更改']; //设置记录信息 $record = [ 'lst_id' => $logistics['id'], @@ -276,7 +276,7 @@ class LogisticsLogic extends BaseLogic 'create_time' => time(), ]; //更改物流信息状态 - $res = self::status($params['logistics_id'], 4,$record); + $res = self::status($logistics['id'], 4,$record); if($res){ return ['code'=>1, 'msg'=>'操作成功']; }else{