Kaynağa Gözat

特价满减

shish 2 yıl önce
ebeveyn
işleme
081e9e95eb
1 değiştirilmiş dosya ile 5 ekleme ve 6 silme
  1. 5 6
      app-ghs/controllers/ProductController.php

+ 5 - 6
app-ghs/controllers/ProductController.php

@@ -984,12 +984,6 @@ class ProductController extends BaseController
         }
 
         $post = Yii::$app->request->post();
-
-        //临时兼容,2023.7.1后可以删除
-        $appVersion = $post['appVersion'] ?? 0;
-        if ($appVersion != 1) {
-            util::fail('请先升级应用');
-        }
         $discountPrice = $post['discountPrice'] ?? 0;
         if ($discountPrice > 0) {
             if (isset($post['hjDiscountPrice']) == false || empty($post['hjDiscountPrice'])) {
@@ -1011,6 +1005,11 @@ class ProductController extends BaseController
                 $post['skDiscountPrice'] = $skDiscountPrice;
                 $post['hjDiscountPrice'] = $hjDiscountPrice;
             }
+            $reachNum = $post['reachNum'] ?? 0;
+            $reachNumDiscount = $post['reachNumDiscount'] ?? 0;
+            if ($reachNum > 0 && $reachNumDiscount > 0) {
+                util::fail('特价和满减不能同时进行');
+            }
         }
 
         $post['adminId'] = $this->adminId;