Browse Source

修改预订单花材信息

shish 2 years ago
parent
commit
59ecfe6779
1 changed files with 24 additions and 0 deletions
  1. 24 0
      app-ghs/controllers/OrderItemController.php

+ 24 - 0
app-ghs/controllers/OrderItemController.php

@@ -16,6 +16,27 @@ class OrderItemController extends BaseController
 
 
     public $guestAccess = [];
     public $guestAccess = [];
 
 
+    //修改预订单花材的数量和价格
+    public function actionModifyBookItem()
+    {
+        $post = Yii::$app->request->post();
+        $id = $post['id'] ?? 0;
+        $order = OrderClass::getById($id, true);
+        if (empty($order)) {
+            util::fail('没有订单');
+        }
+        if ($order->mainId != $this->mainId) {
+            util::fail('不是你的订单哦');
+        }
+        if ($order->stockChange == 1) {
+            util::fail('已经入库,不能修改');
+        }
+        if ($order->status != 2) {
+            util::fail('待发货订单才能修改');
+        }
+        util::complete();
+    }
+
     //删除花材 ssh 20240123
     //删除花材 ssh 20240123
     public function actionDelItem()
     public function actionDelItem()
     {
     {
@@ -32,6 +53,9 @@ class OrderItemController extends BaseController
         if ($order->book == 0) {
         if ($order->book == 0) {
             util::fail('不是预订单');
             util::fail('不是预订单');
         }
         }
+        if ($order->mainId != $this->mainId) {
+            util::fail('不是你的订单');
+        }
         if (floatval($order->actPrice) != 0) {
         if (floatval($order->actPrice) != 0) {
             util::fail('订单金额不是0');
             util::fail('订单金额不是0');
         }
         }