shish %!s(int64=2) %!d(string=hai) anos
pai
achega
b3d7af1b2e
Modificáronse 1 ficheiros con 23 adicións e 3 borrados
  1. 23 3
      app-ghs/controllers/ExpendController.php

+ 23 - 3
app-ghs/controllers/ExpendController.php

@@ -53,13 +53,13 @@ class ExpendController extends BaseController
         if (getenv('YII_ENV') == 'production') {
             if (in_array($mainId, [23390])) {
                 if (!in_array($this->adminId, [24655])) {
-                    util::fail('你不能操作');
+                    util::fail('请财务人员操作');
                 }
             }
         } else {
             if (in_array($mainId, [644])) {
-                if (!in_array($this->adminId, [9191])) {
-                    util::fail('你不能操作');
+                if (!in_array($this->adminId, [919])) {
+                    //util::fail('请财务人员操作哈');
                 }
             }
         }
@@ -148,6 +148,26 @@ class ExpendController extends BaseController
     //新增支出 ssh 20220710
     public function actionAddExpend()
     {
+        $staff = $this->shopAdmin;
+        if (isset($staff->finance) == false || $staff->finance == 0) {
+            util::fail('请财务操作。');
+        }
+
+        $mainId = $this->mainId;
+        if (getenv('YII_ENV') == 'production') {
+            if (in_array($mainId, [23390])) {
+                if (!in_array($this->adminId, [24655])) {
+                    util::fail('请财务人员操作吧');
+                }
+            }
+        } else {
+            if (in_array($mainId, [644])) {
+                if (!in_array($this->adminId, [919])) {
+                    //util::fail('请财务人员操作哦');
+                }
+            }
+        }
+
         $post = Yii::$app->request->post();
         $type = $post['type'] ?? -1;
         $amount = $post['amount'] ?? 0;