Procházet zdrojové kódy

红包 指定只有一二个商家有红包活动权利

shish před 4 roky
rodič
revize
cf5ec36264

+ 10 - 0
app-ghs/controllers/RechargeHbController.php

@@ -22,6 +22,16 @@ class RechargeHbController extends BaseController
     {
         $connection = Yii::$app->db;//事务处理
         $transaction = $connection->beginTransaction();
+
+        //指定只有一二个商家有充值活动使用权
+        $env = getenv('YII_ENV', 'local');
+        if ($env == 'production') {
+            $arr = [3, 5, 10, 22, 154, 209, 214];
+            if (in_array($this->shopId, $arr) == false) {
+                util::fail('您没有权限使用此活动');
+            }
+        }
+
         try {
             $data = Yii::$app->request->post('data');
             $arr = json_decode($data, true);

+ 0 - 4
app-hd/controllers/RechargeController.php

@@ -9,7 +9,6 @@ use biz\shop\classes\ShopClass;
 use biz\sj\classes\SjClass;
 use bizHd\wx\classes\WxOpenClass;
 use common\components\dict;
-use common\components\httpUtil;
 use common\components\util;
 use Yii;
 
@@ -151,9 +150,6 @@ class RechargeController extends BaseController
         if ($amount <= 0) {
             util::fail('充值金额有问题');
         }
-        if ($this->sj->parentShopId != $ghsShopId) {
-            util::fail('不能充值,请找第一个邀请您的供应商');
-        }
 
         $wxPay = dict::getDict('payWay', 'wxPay');
         $shopAdmin = $this->shopAdmin->attributes;

+ 0 - 8
biz-hd/purchase/classes/PurchaseClass.php

@@ -187,14 +187,6 @@ class PurchaseClass extends BaseClass
                 $actPrice = bcsub($prePrice, $coupon->amount, 2);
                 $realPrice = $actPrice;
 
-                //红包的限制使用
-                $sj = SjClass::getById($sjId, true);
-                $parentShopId = $sj->parentShopId ?? 0;
-                $ghsShopId = $ghs['shopId'] ?? 0;
-                if (empty($parentShopId) || $parentShopId != $ghsShopId) {
-                    util::fail('此商家不支持使用红包');
-                }
-
             }
 
         }