Explorar o código

Merge branch 'redesign‌-260706' into dev

ouyang hai 19 horas
pai
achega
f6f8030023

+ 1 - 1
app-ghs/controllers/ConsoleController.php

@@ -173,7 +173,7 @@ class ConsoleController extends BaseController
         //$notice[] = ['title' => '如果你发现一个问题很重要,一直没给你处理,在小群多反应几次,用反应次数强调重要性,目前批发店多反应问题多,都在排队。', 'action' => '', 'page' => ''];
         //$notice[] = ['title' => '新功能:客户端和后台使用跑腿的流程', 'action' => '', 'page' => '/admin/book/detail?id=use_pt'];
         //$notice[] = ['title' => '明年1月1号起,所有人介绍新批发店的分红政策,将会统一调整,请知悉', 'action' => '', 'page' => ''];
-        //$notice[] = ['title' => '急事请连续打二次电话 15280215347', 'action' => '', 'page' => ''];
+        //$notice[] = ['title' => '急事请连续打二次电话 15280215347', 'action' => '', 'page' => ''];
 
         $mainId = $this->mainId;
         $respond = StatSaleClass::profile($mainId);

+ 0 - 6
app-ghs/controllers/TestController.php

@@ -238,12 +238,6 @@ class TestController extends BaseController
 
     public function actionHtml()
     {
-        $c = new Converter(null, [
-            "fmt" => "png",
-            "in" => "/tmp/a.html",
-            "out" => "/tmp/test.png"
-        ]);
-        $c->convert();
     }
 
     //欠款的查询与跟踪 ssh 20240103

+ 42 - 9
app-hd/controllers/ApplyController.php

@@ -3,6 +3,7 @@
 namespace hd\controllers;
 
 use biz\shop\classes\ShopClass;
+use biz\renew\classes\RenewClass;
 use biz\shop\services\ShopAdminService;
 use biz\sj\classes\SjClass;
 use bizGhs\admin\classes\AdminClass;
@@ -81,8 +82,9 @@ class ApplyController extends BaseController
     {
         $get = Yii::$app->request->get();
         $inviteCode = trim($get['inviteCode'] ?? '');
-        $data = MainInviteClass::resolveRegisterFeePreview($inviteCode);
-        util::success($data);
+        $allowInviteBenefit = $this->canUseRegisterInviteBenefit();
+        $data = MainInviteClass::resolveRegisterFeePreview($inviteCode, $allowInviteBenefit);
+        util::success($this->appendInviteBenefitFlags($data));
     }
 
     /**
@@ -117,7 +119,7 @@ class ApplyController extends BaseController
                 $data['inviteCommissionAmount'] = round((float) ($apply['inviteCommissionAmount'] ?? 0), 2);
             }
         }
-        util::success($data);
+        util::success($this->appendInviteBenefitFlags($data));
     }
 
     /**
@@ -128,14 +130,23 @@ class ApplyController extends BaseController
         if ($this->adminId <= 0 || $this->shopId <= 0) {
             util::fail('请先登录并选择门店');
         }
-        $post = Yii::$app->request->post();
-        $inviteCode = trim((string) ($post['inviteCode'] ?? ''));
+        $allowInviteBenefit = $this->canUseRegisterInviteBenefit();
         $apply = $this->findRegisterApplyForAdmin($this->adminId, $this->shopId);
         if (empty($apply)) {
             util::fail('未找到注册申请记录');
         }
         $applyId = (int) ($apply['id'] ?? 0);
-        $fee = MainInviteClass::resolveRegisterFeeSubmit($inviteCode);
+        // 已有 xhRenew 付费成功:续费不再更新邀请减免
+        if (!$allowInviteBenefit) {
+            $preview = MainInviteClass::resolveRegisterFeePreview('', false);
+            util::success($this->appendInviteBenefitFlags(array_merge($preview, [
+                'applyId' => $applyId,
+            ])));
+            return;
+        }
+        $post = Yii::$app->request->post();
+        $inviteCode = trim((string) ($post['inviteCode'] ?? ''));
+        $fee = MainInviteClass::resolveRegisterFeeSubmit($inviteCode, true);
         if ($inviteCode !== '' && !empty($fee['inviteNotFound'])) {
             util::fail('邀请人不存在');
         }
@@ -146,13 +157,13 @@ class ApplyController extends BaseController
             'hdDiscountAmount' => $hdDiscountAmount,
             'inviteCommissionAmount' => $inviteCommissionAmount,
         ]);
-        $preview = MainInviteClass::resolveRegisterFeePreview($inviteCode);
-        util::success(array_merge($preview, [
+        $preview = MainInviteClass::resolveRegisterFeePreview($inviteCode, true);
+        util::success($this->appendInviteBenefitFlags(array_merge($preview, [
             'applyId' => $applyId,
             'inviteCode' => $inviteCode,
             'hdDiscountAmount' => $hdDiscountAmount,
             'inviteCommissionAmount' => $inviteCommissionAmount,
-        ]));
+        ])));
     }
 
     //邀请花店海报 ssh 20210610
@@ -455,4 +466,26 @@ class ApplyController extends BaseController
         return $apply;
     }
 
+    /**
+     * 是否仍可使用邀请码减免与佣金(无 xhRenew 付费成功记录时为 true)
+     */
+    private function canUseRegisterInviteBenefit(): bool
+    {
+        if ($this->mainId <= 0 && $this->shopId <= 0) {
+            return true;
+        }
+        return !RenewClass::hasPaidMemberRenew((int) $this->mainId, (int) $this->shopId);
+    }
+
+    /**
+     * 补充首次付费邀请权益标记
+     */
+    private function appendInviteBenefitFlags(array $data): array
+    {
+        $available = $this->canUseRegisterInviteBenefit();
+        $data['inviteBenefitAvailable'] = $available ? 1 : 0;
+        $data['hasPaidRegisterRenew'] = $available ? 0 : 1;
+        return $data;
+    }
+
 }

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

@@ -187,7 +187,11 @@ class CustomRechargeController extends BaseController
             $response = $laResource->driveWxPay($wxParams);
             if (isset($response['code']) == false || $response['code'] != 'BBS00000') {
                 $errMsg = $response['msg'] ?? '';
-                noticeUtil::push('编号19881507:' . $errMsg . ' | ' . $ghsName . ' | ' . $customName . ' | ' . $actPrice, '15280215347');
+                $errCode = $response['code'] ?? '';
+                noticeUtil::push('编号19881507:' . $errCode . ' | ' . $errMsg . ' | ' . $ghsName . ' | ' . $customName . ' | ' . $actPrice, '15280215347');
+                if($errCode == 'BBS11109'){
+                    util::fail('超过单笔限额,请分二笔支付');
+                }
                 util::fail('支付失败');
             }
             $newParams = isset($response['resp_data']['acc_resp_fields']) ? $response['resp_data']['acc_resp_fields'] : [];

+ 7 - 7
app-hd/controllers/GhsController.php

@@ -55,7 +55,7 @@ class GhsController extends BaseController
         $perKmPrice = $shCurrentConfig['perKmPrice'] ?? 0;//超出起步,每公里加收金额
         $changeRate = $shCurrentConfig['changeRate'] ?? 0;//负值时为降价百分比,正值时为涨价百分比
         if ($startKm <= 0 || $startPrice <= 0 || $perKmPrice <= 0) {
-            util::success(['sendCost' => 0, 'distanceKm' => 0,'distance'=>0]);
+            util::success(['sendCost' => 0, 'distanceKm' => 0, 'distance' => 0]);
         }
         //计算客户到店的距离,骑电动车
         $distanceRespond = mapUtil::calcShopDistanceByEleBike($custom, $ghs, 0);
@@ -64,7 +64,7 @@ class GhsController extends BaseController
         $distance = floatval($distance);
         $sendDistance = floatval($sendDistance);
         if ($sendDistance <= 0) {
-            util::success(['sendCost' => 0, 'distanceKm' => 0,'distance'=>0]);
+            util::success(['sendCost' => 0, 'distanceKm' => 0, 'distance' => 0]);
         }
         // 计算运费逻辑
         $sendCost = $startPrice;
@@ -79,7 +79,7 @@ class GhsController extends BaseController
             $sendCost = bcmul($sendCost, $rate, 2);
         }
         $sendCost = floatval($sendCost);
-        util::success(['sendCost' => $sendCost, 'distanceKm' => $sendDistance,'distance'=>$distance]);
+        util::success(['sendCost' => $sendCost, 'distanceKm' => $sendDistance, 'distance' => $distance]);
     }
 
     //提示花店有多个供货商
@@ -379,8 +379,8 @@ class GhsController extends BaseController
         /*****此区域部分可以考虑删除******/
 
         //是否使用新的配送方式,关键词 sh_method_area
-        $newShMethod = dict::getNewMethodShop();
-        $ghsInfo['useNewShMethod'] = in_array($ghsShopId, $newShMethod) ? 1 : 0;
+        $newStatus = dict::getNewMethod($ghsShopId);
+        $ghsInfo['useNewShMethod'] = $newStatus ? 1 : 0;
 
         util::success($ghsInfo);
     }
@@ -443,8 +443,8 @@ class GhsController extends BaseController
             $ghs['pfLevel'] = $ghsShop->pfLevel ?? 0;
 
             //是否使用新的配送方式,关键词 sh_method_area
-            $newShMethod = dict::getNewMethodShop();
-            $ghs['useNewShMethod'] = in_array($ghsShopId, $newShMethod) ? 1 : 0;
+            $newStatus = dict::getNewMethod($ghsShopId);
+            $ghs['useNewShMethod'] = $newStatus ? 1 : 0;
 
         } else {
             //没有开店也给显示供货商信息

+ 4 - 4
app-hd/controllers/PurchaseController.php

@@ -621,8 +621,8 @@ class PurchaseController extends BaseController
             } else {
 
                 // xhShMethod 门店:下单前按配置写入不满最低消费时的附加包装费/运费,关键词 sh_method_area
-                $newShMethod = dict::getNewMethodShop();
-                if (in_array($ghsShopId, $newShMethod)) {
+                $newStatus = dict::getNewMethod($ghsShopId);
+                if ($newStatus) {
 
                     $shCurrentConfig = shMethodClass::getConfig($ghsShopId, $ghsMainId, $sendType);
                     $shCurrentName = $shCurrentConfig['name'] ?? '';
@@ -804,8 +804,8 @@ class PurchaseController extends BaseController
 
             $respond = PurchaseService::createPurchase($post, $ghsInfo);
 
-            $newShMethod = dict::getNewMethodShop();
-            if (in_array($ghsShopId, $newShMethod)) {
+            $newStatus = dict::getNewMethod($ghsShopId);
+            if ($newStatus) {
                 // 使用 xhShMethod 配置校验配送限制,替代旧版门店硬编码规则,关键词 sh_method_area
                 $shMethodError = ShMethodClass::checkLimit(
                     $ghsShopId,

+ 10 - 4
app-hd/controllers/RenewController.php

@@ -3,6 +3,7 @@
 namespace hd\controllers;
 
 use biz\set\classes\SetClass;
+use biz\renew\classes\RenewClass;
 use biz\sj\services\MerchantExtendService;
 use biz\sj\services\MerchantService;
 use bizHd\saas\classes\ApplyClass;
@@ -105,6 +106,8 @@ class RenewController extends BaseController
         $registerConfig = dict::getDict('hdRegisterConfig');
         $prePrice = round((float) ($registerConfig['price'] ?? 0), 2);
         $hdDiscountAmount = 0;
+        $attachApplyId = 0;
+        $allowInviteBenefit = !RenewClass::hasPaidMemberRenew((int) $this->mainId, (int) $this->shopId);
         if ($applyId > 0) {
             $apply = ApplyClass::getById($applyId);
             if (empty($apply)) {
@@ -113,7 +116,10 @@ class RenewController extends BaseController
             if ((int) ($apply['adminId'] ?? 0) !== (int) $this->adminId) {
                 util::fail('申请与当前账号不匹配');
             }
-            $hdDiscountAmount = round((float) ($apply['hdDiscountAmount'] ?? 0), 2);
+            if ($allowInviteBenefit) {
+                $hdDiscountAmount = round((float) ($apply['hdDiscountAmount'] ?? 0), 2);
+                $attachApplyId = $applyId;
+            }
         }
         $actPrice = round(max(0, $prePrice - $hdDiscountAmount), 2);
 
@@ -139,7 +145,7 @@ class RenewController extends BaseController
             'status' => 0,
             'type' => 1,
             'ptStyle' => dict::getDict('ptStyle', 'hd'),
-            'remark' => $applyId > 0 ? 'applyId=' . $applyId : '',
+            'remark' => $attachApplyId > 0 ? 'applyId=' . $attachApplyId : '',
             'beforeDeadline'=>$shop->beforeDeadline ?? '',
         ];
 
@@ -155,7 +161,7 @@ class RenewController extends BaseController
                 dict::getDict('payWay', 'wxPay'),
                 $orderSn,
                 $actPrice,
-                'capitalType=' . dict::getDict('capitalType', 'xhRenew', 'id') . '&applyId=' . $applyId,
+                'capitalType=' . dict::getDict('capitalType', 'xhRenew', 'id') . '&applyId=' . $attachApplyId,
                 ''
             );
             util::success([
@@ -174,7 +180,7 @@ class RenewController extends BaseController
         }
 
         $capitalType = dict::getDict('capitalType', 'xhRenew', 'id');
-        $attach = 'capitalType=' . $capitalType . '&applyId=' . $applyId . '&sjId=' . $this->sjId;
+        $attach = 'capitalType=' . $capitalType . '&applyId=' . $attachApplyId . '&sjId=' . $this->sjId;
 
         $wx = Yii::getAlias('@vendor/weixin');
         require_once $wx . '/lib/WxPay.Api.php';

+ 15 - 1
app-mall/controllers/GroupBuyController.php

@@ -10,6 +10,7 @@ use bizHd\groupBuy\classes\GroupBuyMemberClass;
 use bizHd\order\services\OrderService;
 use bizHd\shop\classes\ShopClass;
 use bizMall\hd\classes\HdClass;
+use bizMall\pictext\classes\PicTextGoodsClass;
 use common\components\business;
 use common\components\dict;
 use common\components\orderSn;
@@ -31,8 +32,9 @@ class GroupBuyController extends BaseController
     ];
 
     /**
-     * 团购商品落地页:活动商品信息 + 当前最快成团开放团
+     * 团购商品落地页:活动商品信息 + 商品详情图文 + 当前最快成团开放团
      * GET goodsId
+     * 返回字段与商品详情页对齐:picTextGoods(标题/content JSON)供前端 rich-media-viewer 渲染
      */
     public function actionGoodsLanding()
     {
@@ -55,7 +57,9 @@ class GroupBuyController extends BaseController
             $formatted = business::formatUploadImg($cover);
             $coverUrl = $formatted['url'] ?? $cover;
         }
+        // 轮播图兜底:保留商品图集;详情正文以 picTextGoods 为准(与 GoodsController::actionDetail 一致)
         $detailImages = [];
+        $picTextGoods = [];
         if (!empty($goods)) {
             $pics = $goods->detail ?? ($goods->pic ?? '');
             if (is_string($pics) && $pics !== '') {
@@ -73,6 +77,15 @@ class GroupBuyController extends BaseController
                     }
                 }
             }
+            // 规格商品详情图文挂在主商品上,与商品详情接口取值规则一致
+            $picTextGoodsId = empty($goods->masterId) ? $goodsId : intval($goods->masterId);
+            $picTextRow = PicTextGoodsClass::getByCondition([
+                'mainId' => $mainId,
+                'goodsId' => $picTextGoodsId,
+            ], true);
+            if (!empty($picTextRow)) {
+                $picTextGoods = $picTextRow;
+            }
         }
         $openGroup = GroupBuyClass::getHottestOpenGroup(
             $mainId,
@@ -101,6 +114,7 @@ class GroupBuyController extends BaseController
             'desc' => strval($row['desc']),
             'showCountdown' => intval($row['showCountdown']),
             'detailImages' => $detailImages,
+            'picTextGoods' => $picTextGoods,
             'openGroup' => $openGroup,
         ]);
     }

+ 8 - 0
app-pt/controllers/ApplyController.php

@@ -36,10 +36,18 @@ class ApplyController extends BaseController
     {
         $get = Yii::$app->request->get();
         $status = $get['status'] ?? 0;
+        $name = $get['name'] ?? '';
         $where = [];
         if (!empty($status)) {
             $where['status'] = $status;
         }
+        if (!empty($name)) {
+            if (is_numeric($name)) {
+                $where['mobile'] = ['like', $name];
+            } else {
+                $where['name'] = ['like', $name];
+            }
+        }
         $list = ApplyService::getApplyList($where);
         util::success($list);
     }

+ 71 - 1
app-pt/controllers/ShopController.php

@@ -97,13 +97,83 @@ class ShopController extends BaseController
         util::complete();
     }
 
+    //修改/批量修改门店终端号、到期时间、续费状态等信息
+    public function actionUpdate()
+    {
+        $post = Yii::$app->request->post();
+        $isBatch = $post['isBatch'] ?? 0;
+        $ids = $post['ids'] ?? $post['id'] ?? [];
+        if (is_string($ids)) {
+            $ids = array_filter(array_map('trim', explode(',', $ids)));
+        } elseif (is_numeric($ids)) {
+            $ids = [(int)$ids];
+        }
+        if (empty($ids)) {
+            util::fail('缺少门店ID');
+        }
+
+        $shops = ShopClass::getAllByCondition(['id' => ['in', $ids]], null, '*', null, true);
+        if (empty($shops)) {
+            util::fail('没有找到对应门店');
+        }
+
+        foreach ($shops as $shop) {
+            if (!empty($isBatch) || count($ids) > 1) {
+                // 批量修改模式:只更新有传且不为空/不为-1的字段
+                if (isset($post['lklSjNo']) && trim((string)$post['lklSjNo']) !== '') {
+                    $shop->lklSjNo = trim((string)$post['lklSjNo']);
+                }
+                if (isset($post['lklB2BTermNo']) && trim((string)$post['lklB2BTermNo']) !== '') {
+                    $shop->lklB2BTermNo = trim((string)$post['lklB2BTermNo']);
+                }
+                if (isset($post['lklScanTermNo']) && trim((string)$post['lklScanTermNo']) !== '') {
+                    $shop->lklScanTermNo = trim((string)$post['lklScanTermNo']);
+                }
+                if (isset($post['deadline']) && trim((string)$post['deadline']) !== '') {
+                    $shop->deadline = trim((string)$post['deadline']);
+                }
+                if (isset($post['beforeDeadline']) && trim((string)$post['beforeDeadline']) !== '') {
+                    $shop->beforeDeadline = trim((string)$post['beforeDeadline']);
+                }
+                if (isset($post['hasRenew']) && $post['hasRenew'] !== '' && (int)$post['hasRenew'] !== -1) {
+                    $shop->hasRenew = (int)$post['hasRenew'];
+                }
+            } else {
+                // 单个修改模式:全量覆盖提交的字段
+                if (isset($post['lklSjNo'])) {
+                    $shop->lklSjNo = trim((string)$post['lklSjNo']);
+                }
+                if (isset($post['lklB2BTermNo'])) {
+                    $shop->lklB2BTermNo = trim((string)$post['lklB2BTermNo']);
+                }
+                if (isset($post['lklScanTermNo'])) {
+                    $shop->lklScanTermNo = trim((string)$post['lklScanTermNo']);
+                }
+                if (isset($post['deadline'])) {
+                    $shop->deadline = !empty($post['deadline']) ? trim((string)$post['deadline']) : null;
+                }
+                if (isset($post['beforeDeadline'])) {
+                    $shop->beforeDeadline = !empty($post['beforeDeadline']) ? trim((string)$post['beforeDeadline']) : null;
+                }
+                if (isset($post['hasRenew'])) {
+                    $shop->hasRenew = (int)$post['hasRenew'];
+                }
+            }
+            $shop->save();
+        }
+
+        util::complete('修改成功');
+    }
+
     //门店列表 ssh 20210730
     public function actionList()
     {
         $where = [];
         $name = Yii::$app->request->get('name', '');
         if (!empty($name)) {
-            if (stringUtil::isLetter($name)) {
+            if (is_numeric($name)) {
+                $where['mobile'] = ['like', $name];
+            } elseif (stringUtil::isLetter($name)) {
                 $where['py'] = ['like', $name];
             } else {
                 $where['merchantName'] = ['like', $name];

+ 1 - 1
app-pt/views/main/app.php

@@ -235,7 +235,7 @@
             }
             // 这里可以根据appType跳转到对应的下载链接
             const downloadUrls = {
-                'xiaohuabao': 'https://api.shop.hzghd.com/1312.apk', // 销花宝APP下载链接
+                'xiaohuabao': 'https://api.shop.hzghd.com/1320.apk', // 销花宝APP下载链接
                 'huazhanggui': 'https://api.shop.hzghd.com/246.apk', // 花掌柜APP下载链接
                 'huazhanggui_cashier': 'https://api.shop.hzghd.com/220.apk', // 花掌柜收银下载链接
                 'xiaohuabao_cashier': 'https://api.shop.hzghd.com/178.apk' // 销花宝收银下载链接

+ 11 - 3
biz-hd/shop/classes/MainInviteClass.php

@@ -41,7 +41,7 @@ class MainInviteClass extends BaseClass
     /**
      * 花店注册页:会员价与邀请减免(dict + 可选邀请码)
      */
-    public static function resolveRegisterFeePreview($inviteCode = '')
+    public static function resolveRegisterFeePreview($inviteCode = '', $allowInviteBenefit = true)
     {
         $config = dict::getDict('hdRegisterConfig');
         $price = round((float)($config['price'] ?? 0), 2);
@@ -58,6 +58,10 @@ class MainInviteClass extends BaseClass
             'payAmount' => $price,
         ];
 
+        if (!$allowInviteBenefit) {
+            return $out;
+        }
+
         $code = trim((string)$inviteCode);
         if ($code === '') {
             return $out;
@@ -92,9 +96,9 @@ class MainInviteClass extends BaseClass
     /**
      * 注册提交:费用 + 邀请人 mainId + 佣金快照
      */
-    public static function resolveRegisterFeeSubmit($inviteCode = '')
+    public static function resolveRegisterFeeSubmit($inviteCode = '', $allowInviteBenefit = true)
     {
-        $preview = self::resolveRegisterFeePreview($inviteCode);
+        $preview = self::resolveRegisterFeePreview($inviteCode, $allowInviteBenefit);
         $config = dict::getDict('hdRegisterConfig');
         $configComm = round((float) ($config['commissionAmount'] ?? 0), 2);
 
@@ -103,6 +107,10 @@ class MainInviteClass extends BaseClass
         $preview['inviterMainId'] = 0;
         $preview['inviteCommissionAmount'] = 0;
 
+        if (!$allowInviteBenefit) {
+            return $preview;
+        }
+
         if (!empty($preview['inviteNotFound'])) {
             return $preview;
         }

+ 44 - 1
biz/renew/classes/RenewClass.php

@@ -7,6 +7,7 @@ use biz\shop\classes\ShopClass;
 use biz\sj\classes\SjClass;
 use bizHd\saas\classes\ApplyClass;
 use bizHd\shop\classes\MainInviteClass;
+use common\components\dict;
 use common\components\noticeUtil;
 use common\components\util;
 use Yii;
@@ -22,6 +23,48 @@ class RenewClass extends BaseClass
         return $data;
     }
 
+    /**
+     * 是否已有 xhRenew 付费成功记录(同一 main/shop 仅首次付费享受邀请减免与佣金)
+     */
+    public static function hasPaidMemberRenew(int $mainId, int $shopId = 0): bool
+    {
+        $ptStyle = dict::getDict('ptStyle', 'hd');
+        if ($mainId > 0) {
+            $row = self::getByCondition(['mainId' => $mainId, 'status' => 1, 'ptStyle' => $ptStyle], false);
+            if (!empty($row)) {
+                return true;
+            }
+        }
+        if ($shopId > 0) {
+            $row = self::getByCondition(['shopId' => $shopId, 'status' => 1, 'ptStyle' => $ptStyle], false);
+            return !empty($row);
+        }
+        return false;
+    }
+
+    /**
+     * 除当前订单外是否已有付费成功的 xhRenew(回调写佣金时用)
+     */
+    public static function hasOtherPaidMemberRenew(int $mainId, string $excludeOrderSn = ''): bool
+    {
+        if ($mainId <= 0) {
+            return false;
+        }
+        $ptStyle = dict::getDict('ptStyle', 'hd');
+        $list = self::getRenewList(['mainId' => $mainId, 'status' => 1, 'ptStyle' => $ptStyle]);
+        if (empty($list)) {
+            return false;
+        }
+        foreach ($list as $item) {
+            $sn = is_array($item) ? (string) ($item['orderSn'] ?? '') : (string) ($item->orderSn ?? '');
+            if ($excludeOrderSn !== '' && $sn === $excludeOrderSn) {
+                continue;
+            }
+            return true;
+        }
+        return false;
+    }
+
     public static function thirdPay($payWay, $orderSn, $totalFee, $attach, $transactionId)
     {
         $renew = self::getByCondition(['orderSn' => $orderSn], true);
@@ -84,7 +127,7 @@ class RenewClass extends BaseClass
         $renew->status = 1;
         $renew->save();
 
-        if ($isRegisterMember) {
+        if ($isRegisterMember && !self::hasOtherPaidMemberRenew((int) $mainId, (string) $orderSn)) {
             $apply = ApplyClass::getById($applyId);
             if (!empty($apply)) {
                 MainInviteClass::grantInviterCommission(

+ 9 - 2
common/components/dict.php

@@ -704,14 +704,21 @@ class dict
         return $respond;
     }
 
-    public static function getNewMethodShop()
+    public static function getNewMethod($shopId)
     {
         $newShop = !getenv('NEW_METHOD_SHOP') ? '' : getenv('NEW_METHOD_SHOP');
         if (empty($newShop)) {
             return [];
         }
         $newShop = trim($newShop);
-        return explode(',', $newShop);
+        $arr = explode(',', $newShop);
+        if (empty($arr)) {
+            return false;
+        }
+        if (in_array($shopId, $arr)) {
+            return true;
+        }
+        return false;
     }
 
 }

+ 2 - 0
common/config/main-local.php

@@ -9,6 +9,8 @@ if (getenv('YII_ENV') == 'production') {
             'debug' => [
                 'class' => 'yii\debug\Module',
                 'allowedIPs' => [getenv('DEBUG_ALLOWED_IP','127.0.0.1')],
+                // Debug 工具栏保留的历史请求条数,默认 50 条过少
+                'historySize' => 10000,
             ],
             'gii' => [
                 'class' => 'yii\gii\Module',