shish 11 months ago
parent
commit
0132c64ff4

+ 6 - 1
app-hd/controllers/ProductController.php

@@ -122,11 +122,16 @@ class ProductController extends BaseController
         //扫码收款、直接收款和特价商品,不可删除,多处要同步修改 system_item
         if (getenv('YII_ENV') == 'production') {
             $systemItem = [78076, 80960, 81004];
+            $adminList = [4, 1960];
         } else {
             $systemItem = [11157, 11156, 11158];
+            $adminList = [919, 932];
         }
         if (in_array($product->itemId, $systemItem)) {
-            util::fail('系统花材,不可删除');
+            $adminId = $this->adminId;
+            if (!in_array($adminId, $adminList)) {
+                util::fail('系统花材,不可删除');
+            }
         }
 
         $product->delStatus = $delStatus;

+ 5 - 1
biz-ghs/product/classes/ProductClass.php

@@ -1466,11 +1466,15 @@ class ProductClass extends BaseClass
         //扫码收款、直接收款,不包括特价商品,不可修改,多处要同步修改 system_item
         if (getenv('YII_ENV') == 'production') {
             $systemItem = [78076, 80960];
+            $adminList = [4, 1960];
         } else {
             $systemItem = [11157, 11156];
+            $adminList = [919, 932];
         }
         if (in_array($product->itemId, $systemItem)) {
-            util::fail('系统花材,不可修改');
+            if (!in_array($adminId, $adminList)) {
+                util::fail('系统花材,不可修改');
+            }
         }
 
         $name = $product->name ?? '';