shish 5 år sedan
förälder
incheckning
28822ff2fd
1 ändrade filer med 20 tillägg och 1 borttagningar
  1. 20 1
      app-ghs/controllers/CheckOrderController.php

+ 20 - 1
app-ghs/controllers/CheckOrderController.php

@@ -54,6 +54,11 @@ class CheckOrderController extends BaseController
     //盘点存草稿 linqh 2021.1.22
     public function actionCreateDraft()
     {
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能操作');
+        }
+
         $post = Yii::$app->request->post();
         $post['sjId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
@@ -68,6 +73,11 @@ class CheckOrderController extends BaseController
     //编辑草稿 ,继续保存草稿
     public function actionUpdateDraft()
     {
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能操作');
+        }
+
         $post = Yii::$app->request->post();
         $post['sjId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
@@ -84,6 +94,11 @@ class CheckOrderController extends BaseController
     //编辑草稿, 确认
     public function actionUpdateOrder()
     {
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能操作');
+        }
+
         $post = Yii::$app->request->post();
         $post['sjId'] = $this->sjId;
         $post['shopId'] = $this->shopId;
@@ -98,6 +113,11 @@ class CheckOrderController extends BaseController
 
     protected function saveOrder($post,$draft=false,$update=false)
     {
+        $shopAdmin = $this->shopAdmin;
+        if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
+            util::fail('超管才能操作');
+        }
+
         $ghsItemInfo = $post['itemInfo']??'';
         if(empty($ghsItemInfo)){
             util::fail('请选择花材');
@@ -115,7 +135,6 @@ class CheckOrderController extends BaseController
         }else{
             $order = CheckOrderClass::opOrder($post,$draft,$update);
         }
-
         if($order){
             util::success($order);
         }else{