Przeglądaj źródła

不能低于原价卖货

shish 8 miesięcy temu
rodzic
commit
344b410563
1 zmienionych plików z 17 dodań i 1 usunięć
  1. 17 1
      app-ghs/controllers/OrderController.php

+ 17 - 1
app-ghs/controllers/OrderController.php

@@ -1223,12 +1223,28 @@ class OrderController extends BaseController
         $priceMap = CustomClass::$levelPriceKeyMap;
         $addPriceMap = CustomClass::$levelAddPriceKeyMap;
         $level = $custom['level'] ?? 1;
-        foreach ($productList as $currentKey => $currentProduct) {
+        foreach ($productList as $currentProduct) {
             $currentPrice = $currentProduct['price'] ?? 0;
             $currentId = $currentProduct['productId'] ?? 0;
             $systemInfo = $itemInfo[$currentId] ?? [];
             $name = $systemInfo['name'] ?? '';
             $systemPrice = ProductClass::getFinalPrice($systemInfo, $level, $priceMap, $addPriceMap);
+
+            if (getenv('YII_ENV') == 'production') {
+                //苏州小蔡鲜花,几个出车,不能低于原价卖,但可以高于原价卖的
+                if (in_array($shopId, [38231, 38143, 29163, 29161])) {
+                    if ($currentPrice < $systemPrice) {
+                        util::fail('不能低于原价卖');
+                    }
+                }
+            } else {
+                if (in_array($shopId, [36544])) {
+                    if ($currentPrice < $systemPrice) {
+                        util::fail('不能低于原价卖');
+                    }
+                }
+            }
+
             if (floatval($currentPrice) != floatval($systemPrice)) {
                 $diff[] = [
                     'name' => $name,