Kaynağa Gözat

超管才能结帐

shish 5 yıl önce
ebeveyn
işleme
9759e2000a
1 değiştirilmiş dosya ile 8 ekleme ve 2 silme
  1. 8 2
      app-ghs/controllers/OrderClearController.php

+ 8 - 2
app-ghs/controllers/OrderClearController.php

@@ -14,6 +14,12 @@ class OrderClearController extends BaseController
     //收款 ssh 2021.2.4
     public function actionClear()
     {
+
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能结帐');
+        }
+
         $id = Yii::$app->request->post('id');
         $customId = Yii::$app->request->post('customId', 0);
         if (empty($id)) {
@@ -45,7 +51,7 @@ class OrderClearController extends BaseController
             }
         }
 
-        $payWay = Yii::$app->request->post('payWay',0);
+        $payWay = Yii::$app->request->post('payWay', 0);
 
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
@@ -55,7 +61,7 @@ class OrderClearController extends BaseController
             'ghsShopAdminId' => $this->shopAdminId,
             'ghsShopAdminName' => $name,
             'modifyPrice' => $modifyPrice,
-            'payWay'=>$payWay,
+            'payWay' => $payWay,
         ];
         try {
             OrderClearClass::clear($data, $id, $this->sjId, $this->shopId);