From 6d5c38a1454c9489dce70eaa86d628b192edebd7 Mon Sep 17 00:00:00 2001 From: zengyyh Date: Tue, 24 Sep 2024 21:59:44 +0800 Subject: [PATCH 1/2] 123 --- app/store/controller/Order.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/store/controller/Order.php b/app/store/controller/Order.php index a5c296f9..e8a22026 100644 --- a/app/store/controller/Order.php +++ b/app/store/controller/Order.php @@ -22,6 +22,7 @@ use app\store\model\OrderRefund as OrderRefundModel; use app\common\model\UploadFile; use app\common\model\TransferRecord as TransferRecordModel; use app\api\model\Express as ExpressModel; +use app\common\model\order\Delivery as DeliveryModel; /** * 订单管理 @@ -303,5 +304,12 @@ class Order extends Controller return $this->renderSuccess(compact('list')); } + public function updateDelivery(int $delivery_id): Json + { + $model = new DeliveryModel; + $model->where('delivery_id', $delivery_id)->save($this->postForm()); + return $this->renderSuccess('ok'); + } + } From 5a5291f356072dbeb5265d6a548b8ac5bd6e2aaa Mon Sep 17 00:00:00 2001 From: zengyyh Date: Tue, 24 Sep 2024 22:05:26 +0800 Subject: [PATCH 2/2] 123 --- app/store/controller/Order.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/store/controller/Order.php b/app/store/controller/Order.php index e8a22026..ebf4e51e 100644 --- a/app/store/controller/Order.php +++ b/app/store/controller/Order.php @@ -307,8 +307,13 @@ class Order extends Controller public function updateDelivery(int $delivery_id): Json { $model = new DeliveryModel; + if(!$model->where('delivery_id', $delivery_id)->find()) + { + return $this->renderError('该物流记录不存在'); + } + $model->where('delivery_id', $delivery_id)->save($this->postForm()); - return $this->renderSuccess('ok'); + return $this->renderSuccess('修改成功'); }