shish 4 lat temu
rodzic
commit
967fadc82e
1 zmienionych plików z 10 dodań i 10 usunięć
  1. 10 10
      app-ghs/controllers/PurchaseOrderController.php

+ 10 - 10
app-ghs/controllers/PurchaseOrderController.php

@@ -158,16 +158,16 @@ class PurchaseOrderController extends BaseController
 
         if (getenv('YII_ENV') == 'production') {
             //阿东的创始人才能查看采购单
-            if ($this->mainId == 742) {
+            if (in_array($this->mainId, [742])) {
                 $staff = $this->shopAdmin;
-                if (isset($staff['founder']) == false || $staff['founder'] != 2) {
+                if (isset($staff->founder) == false || $staff->founder != 2) {
                     util::fail('没有权限');
                 }
             }
-        }else{
-            if ($this->mainId == 661) {
+        } else {
+            if (in_array($this->mainId, [644])) {
                 $staff = $this->shopAdmin;
-                if (isset($staff['founder']) == false || $staff['founder'] != 2) {
+                if (isset($staff->founder) == false || $staff->founder != 2) {
                     util::fail('没有权限');
                 }
             }
@@ -197,16 +197,16 @@ class PurchaseOrderController extends BaseController
 
         if (getenv('YII_ENV') == 'production') {
             //阿东的创始人才能查看采购单
-            if ($this->mainId == 742) {
+            if (in_array($this->mainId, [742])) {
                 $staff = $this->shopAdmin;
-                if (isset($staff['founder']) == false || $staff['founder'] != 2) {
+                if (isset($staff->founder) == false || $staff->founder != 2) {
                     util::fail('没有权限');
                 }
             }
-        }else{
-            if ($this->mainId == 644) {
+        } else {
+            if (in_array($this->mainId, [644])) {
                 $staff = $this->shopAdmin;
-                if (isset($staff['founder']) == false || $staff['founder'] != 2) {
+                if (isset($staff->founder) == false || $staff->founder != 2) {
                     util::fail('没有权限');
                 }
             }