shish 4 år sedan
förälder
incheckning
967fadc82e
1 ändrade filer med 10 tillägg och 10 borttagningar
  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 (getenv('YII_ENV') == 'production') {
             //阿东的创始人才能查看采购单
             //阿东的创始人才能查看采购单
-            if ($this->mainId == 742) {
+            if (in_array($this->mainId, [742])) {
                 $staff = $this->shopAdmin;
                 $staff = $this->shopAdmin;
-                if (isset($staff['founder']) == false || $staff['founder'] != 2) {
+                if (isset($staff->founder) == false || $staff->founder != 2) {
                     util::fail('没有权限');
                     util::fail('没有权限');
                 }
                 }
             }
             }
-        }else{
-            if ($this->mainId == 661) {
+        } else {
+            if (in_array($this->mainId, [644])) {
                 $staff = $this->shopAdmin;
                 $staff = $this->shopAdmin;
-                if (isset($staff['founder']) == false || $staff['founder'] != 2) {
+                if (isset($staff->founder) == false || $staff->founder != 2) {
                     util::fail('没有权限');
                     util::fail('没有权限');
                 }
                 }
             }
             }
@@ -197,16 +197,16 @@ class PurchaseOrderController extends BaseController
 
 
         if (getenv('YII_ENV') == 'production') {
         if (getenv('YII_ENV') == 'production') {
             //阿东的创始人才能查看采购单
             //阿东的创始人才能查看采购单
-            if ($this->mainId == 742) {
+            if (in_array($this->mainId, [742])) {
                 $staff = $this->shopAdmin;
                 $staff = $this->shopAdmin;
-                if (isset($staff['founder']) == false || $staff['founder'] != 2) {
+                if (isset($staff->founder) == false || $staff->founder != 2) {
                     util::fail('没有权限');
                     util::fail('没有权限');
                 }
                 }
             }
             }
-        }else{
-            if ($this->mainId == 644) {
+        } else {
+            if (in_array($this->mainId, [644])) {
                 $staff = $this->shopAdmin;
                 $staff = $this->shopAdmin;
-                if (isset($staff['founder']) == false || $staff['founder'] != 2) {
+                if (isset($staff->founder) == false || $staff->founder != 2) {
                     util::fail('没有权限');
                     util::fail('没有权限');
                 }
                 }
             }
             }