ソースを参照

充值送红包送余额

shish 7 ヶ月 前
コミット
2d8bee4fe0

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

@@ -12,75 +12,11 @@ class RechargeHbController extends BaseController
 
     public function actionDetail()
     {
-        util::fail('已停用');
-
-        $list = RechargeHbClass::getAllByCondition(['shopId' => $this->shopId, 'delStatus' => 0], 'amount DESC', '*');
-        $recharge = $this->shop->recharge ?? 0;
-        util::success(['list' => $list, 'recharge' => $recharge]);
     }
 
     //保存红包内容 ssh 20210930
     public function actionSaveHb()
     {
-        $connection = Yii::$app->db;
-        $transaction = $connection->beginTransaction();
-
-        util::fail('已停用');
-
-        //指定只有一二个商家有充值活动使用权
-        $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);
-            if (is_array($arr) == false) {
-                util::fail('数据错误');
-            }
-            RechargeHbClass::updateByCondition(['shopId' => $this->shopId], ['delStatus' => 1]);
-            $arr = arrayUtil::arraySort($arr, 'amount');
-            foreach ($arr as $key => $item) {
-
-                $mini = $item['miniExpend'] ?? 0;
-                $hbAmount = $item['hbAmount'] ?? 0;
-                if ($mini <= $hbAmount) {
-                    util::fail('最低消费金额要大于红包金额');
-                }
-                $valid = $item['valid'] ?? 0;
-                if (empty($valid)) {
-                    util::fail('请填写红包有效期');
-                }
-                $num = $item['num'] ?? 0;
-                if ($num <= 0) {
-                    util::fail('请填写红包数量');
-                }
-                $totalHb = bcmul($hbAmount, $num, 2);
-                $amount = $item['amount'] ?? 0;
-                if ($totalHb >= $amount) {
-                    $index = $key + 1;
-                    util::fail('第' . $index . '个红包,红包总金额超过充值金额');
-                }
-
-                $item['shopId'] = $this->shopId;
-                $item['sjId'] = $this->sjId;
-                $item['totalHb'] = $totalHb;
-                RechargeHbClass::add($item);
-            }
-            $rechargeSwitch = Yii::$app->request->post('rechargeSwitch', 0);
-            $this->shop->recharge = $rechargeSwitch;
-            $this->shop->save();
-
-            $transaction->commit();
-            util::complete();
-        } catch (\Exception $e) {
-            $transaction->rollBack();
-            util::fail('没有保存成功');
-        }
     }
 
 }

+ 2 - 4
app-hd/controllers/GhsController.php

@@ -237,8 +237,7 @@ class GhsController extends BaseController
         $ghsShopId = $ghsInfo['shopId'] ?? 0;
         $ghsShop = ShopClass::getById($ghsShopId, true);
         $ghsInfo['hasRechargeHb'] = $ghsShop->recharge ?? 0;
-        $hb = RechargeHbClass::getByCondition(['shopId' => $ghsShopId, 'delStatus' => 0], true, 'totalHb DESC');
-        $ghsInfo['hasRechargeHbAmount'] = $hb->totalHb ?? 0;
+        $ghsInfo['hasRechargeHbAmount'] = 0;
         $ghsInfo['xrFl'] = $ghsShop->xrFl ?? 0;
         $ghsInfo['xrFlAmount'] = $ghsShop->xrFlAmount ?? 0;
         $ghsInfo['tjFl'] = $ghsShop->tjFl ?? 0;
@@ -333,8 +332,7 @@ class GhsController extends BaseController
             $ghsShopId = $ghs['shopId'] ?? 0;
             $ghsShop = ShopClass::getById($ghsShopId, true);
             $ghs['hasRechargeHb'] = $ghsShop->recharge ?? 0;
-            $hb = RechargeHbClass::getByCondition(['shopId' => $ghsShopId, 'delStatus' => 0], true, 'totalHb DESC');
-            $ghs['hasRechargeHbAmount'] = $hb->totalHb ?? 0;
+            $ghs['hasRechargeHbAmount'] = 0;
 
             $avatar = $ghs['avatar'] ?? '';
             $ghs['avatar'] = imgUtil::groupImg($avatar);

+ 1 - 2
app-hd/controllers/RechargeController.php

@@ -4,7 +4,6 @@ namespace hd\controllers;
 
 use biz\ghs\classes\GhsClass;
 use biz\recharge\classes\RechargeClass;
-use biz\recharge\classes\RechargeHbClass;
 use biz\shop\classes\ShopClass;
 use biz\sj\classes\SjClass;
 use bizGhs\custom\classes\CustomClass;
@@ -361,7 +360,7 @@ class RechargeController extends BaseController
         }
         GhsClass::valid($ghsInfo, $this->shopId);
         $ghsShopId = $ghsInfo['shopId'] ?? 0;
-        $hbInfo = RechargeHbClass::getById($hbId, true);
+        $hbInfo = [];
         if (empty($hbInfo)) {
             util::fail('无效活动');
         }

+ 1 - 5
app-hd/controllers/RechargeHbController.php

@@ -13,11 +13,7 @@ class RechargeHbController extends BaseController
     //获取供货商充值红包列表 ssh 20210930
     public function actionGetGhsHb()
     {
-        $ghsId = Yii::$app->request->get('ghsId', 0);
-        $ghsInfo = GhsClass::getById($ghsId, true);
-        GhsClass::valid($ghsInfo, $this->shopId);
-        $ghsShopId = $ghsInfo->shopId ?? 0;
-        $list = RechargeHbClass::getAllByCondition(['shopId' => $ghsShopId, 'delStatus' => 0], 'amount DESC', '*', null);
+        $list = [];
         util::success(['list' => $list]);
     }
 

+ 1 - 1
biz-hd/member/models/MemberWeal.php

@@ -7,7 +7,7 @@ class MemberWeal extends Base
 
     public static function tableName()
     {
-        return 'xhMemberRecharge';
+        return 'xhRechargeSye';
     }
 
 }

+ 1 - 1
biz-mall/member/models/MemberWeal.php

@@ -9,7 +9,7 @@ class MemberWeal extends Base
 
     public static function tableName()
     {
-        return 'xhMemberRecharge';
+        return 'xhRechargeSye';
     }
 
 }

+ 1 - 1
biz/recharge/models/RechargeHb.php

@@ -9,7 +9,7 @@ class RechargeHb extends Base
 
     public static function tableName()
     {
-        return 'xhRechargeFl';
+        return 'xhRechargeShb';
     }
 
 }