Răsfoiți Sursa

充值销单限制

shish 2 ani în urmă
părinte
comite
e6f7bc5b5e

+ 35 - 1
app-ghs/controllers/CustomController.php

@@ -32,7 +32,41 @@ class CustomController extends BaseController
 
         $staff = $this->shopAdmin;
         if (isset($staff->finance) == false || $staff->finance == 0) {
-            util::fail('请让财务充值');
+            util::fail('无法充值销单。。。');
+        }
+
+        //多个地方需要同步修改clear_order_power
+        if (getenv('YII_ENV') == 'production') {
+            //花样年华只有总控才能结账
+            if (in_array($this->shopId, [1585, 1596])) {
+                if ($this->adminId != 2876) {
+                    util::fail('不能充值销单哦');
+                }
+            }
+            //花大苪 洋桔梗,只有叶荷姐才能销账
+            if (in_array($this->shopId, [16070])) {
+                if (!in_array($this->adminId, [9303, 4])) {
+                    util::fail('不能充值销单哈');
+                }
+            }
+            //天天鲜花 陈江店
+            if (in_array($this->shopId, [763])) {
+                if (!in_array($this->adminId, [2094, 5959])) {
+                    util::fail('不能操作充值销单!');
+                }
+            }
+            //花儿好仙
+            if (in_array($this->shopId, [22666])) {
+                if (!in_array($this->adminId, [12869, 23174])) {
+                    util::fail('不能充值销单哈');
+                }
+            }
+        } else {
+            if (in_array($this->shopId, [36523])) {
+                if ($this->adminId != 919) {
+                    util::fail('暂不能操作充值销单哈');
+                }
+            }
         }
 
         $get = Yii::$app->request->get();

+ 18 - 6
app-ghs/controllers/OrderClearController.php

@@ -121,32 +121,44 @@ class OrderClearController extends BaseController
         $ghsId = $clear->ghsId ?? 0;
         $ghs = GhsClass::getLockById($ghsId);
         if ($ghs->shopId != $this->shopId) {
-            util::fail('没有权');
+            util::fail('没有获得授权');
         }
 
+        $staff = $this->shopAdmin;
+        if (isset($staff->finance) == false || $staff->finance == 0) {
+            util::fail('不能销单...');
+        }
+
+        //多个地方需要同步修改clear_order_power
         if (getenv('YII_ENV') == 'production') {
             //花样年华只有总控才能结账
             if (in_array($this->shopId, [1585, 1596])) {
                 if ($this->adminId != 2876) {
-                    util::fail('暂不能操作');
+                    util::fail('不能销单!');
                 }
             }
             //花大苪 洋桔梗,只有叶荷姐才能销账
             if (in_array($this->shopId, [16070])) {
                 if (!in_array($this->adminId, [9303, 4])) {
-                    util::fail('暂不能操作');
+                    util::fail('不能销单。');
                 }
             }
-            //天天鲜花,只有阿东才能结账
+            //天天鲜花 陈江店
             if (in_array($this->shopId, [763])) {
                 if (!in_array($this->adminId, [2094, 5959])) {
-                    util::fail('暂不能操作');
+                    util::fail('不能销单哦');
+                }
+            }
+            //花儿好仙
+            if (in_array($this->shopId, [22666])) {
+                if (!in_array($this->adminId, [12869, 23174])) {
+                    util::fail('不能充值销单哈');
                 }
             }
         } else {
             if (in_array($this->shopId, [36523])) {
                 if ($this->adminId != 919) {
-                    util::fail('暂不能操作');
+                    util::fail('不能销单哈');
                 }
             }
         }