Browse Source

取消订单

shish 4 years ago
parent
commit
9bf7bd4bd8
1 changed files with 15 additions and 15 deletions
  1. 15 15
      app-hd/controllers/PurchaseController.php

+ 15 - 15
app-hd/controllers/PurchaseController.php

@@ -104,12 +104,12 @@ class PurchaseController extends BaseController
         $info = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
         $info = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
         PurchaseService::valid($info, $this->shopId);
         PurchaseService::valid($info, $this->shopId);
 
 
-//        if ($info->status != 5) {
-//            util::fail('订单已取消');
-//        }
-//        if ($info->status != 1) {
-//            util::fail('订单不是待付款状态');
-//        }
+        if ($info->status == 5) {
+            util::fail('订单已取消');
+        }
+        if ($info->status != 1) {
+            util::fail('订单不是待付款状态');
+        }
 
 
         $ghsId = $info->ghsId;
         $ghsId = $info->ghsId;
         $ghs = GhsClass::getGhsInfo($ghsId);
         $ghs = GhsClass::getGhsInfo($ghsId);
@@ -162,9 +162,9 @@ class PurchaseController extends BaseController
         if ($info->status == 5) {
         if ($info->status == 5) {
             util::fail('订单已取消');
             util::fail('订单已取消');
         }
         }
-//        if ($info->status == 1) {
-//            util::fail('订单不是待付款状态');
-//        }
+        if ($info->status != 1) {
+            util::fail('订单不是待付款状态');
+        }
 
 
         PurchaseService::valid($info, $this->shopId);
         PurchaseService::valid($info, $this->shopId);
         $connection = Yii::$app->db;//事务处理
         $connection = Yii::$app->db;//事务处理
@@ -254,12 +254,12 @@ class PurchaseController extends BaseController
         if (empty($order)) {
         if (empty($order)) {
             util::fail('订单号无效');
             util::fail('订单号无效');
         }
         }
-//        if ($order->status == 5) {
-//            util::fail('订单已取消');
-//        }
-//        if ($order->status == 1) {
-//            util::fail('订单不是待付款状态');
-//        }
+        if ($order->status == 5) {
+            util::fail('订单已取消');
+        }
+        if ($order->status != 1) {
+            util::fail('订单不是待付款状态');
+        }
 
 
         $id = $order->id;
         $id = $order->id;
         $order->changePrice = 2;
         $order->changePrice = 2;