Преглед изворни кода

Merge branch 'redesign‌-260706' into dev

shizhongqi пре 9 часа
родитељ
комит
4639dcdc54

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

@@ -416,7 +416,8 @@ class RefundController extends BaseController
     }
 
     /**
-     * 商城顾客售后审核通过:执行真实退款
+     * 商城顾客售后审核通过:独立于商家即时售后(不读 refundHb)
+     * 执行真实退款后由 HdRefundMallClass::approve 自行判断是否全额/商品退完并退回红包
      * 成功返回资金落地字段,供前端跳转 forwardResult(线下选手选 / 已返充凭证)
      */
     public function actionPass()

+ 138 - 1
app-mall/controllers/ShopController.php

@@ -8,6 +8,7 @@ use bizHd\custom\classes\CustomClass;
 use bizHd\custom\classes\HdClass;
 use bizMall\invite\services\InviteService;
 use bizMall\user\services\UserService;
+use common\components\dict;
 use common\components\imgUtil;
 use Yii;
 use common\components\util;
@@ -15,7 +16,143 @@ use common\components\util;
 class ShopController extends BaseController
 {
 
-    public $guestAccess = ['info'];
+    public $guestAccess = ['info', 'search', 'recommend'];
+
+    /**
+     * 未登录首页「推荐花店」:内容后端写死,按 YII_ENV 区分测试/正式
+     * 返回 shopId、名称、地址、营业时间、封面完整 URL;进店用 account=shopId
+     */
+    public function actionRecommend()
+    {
+        $isProd = getenv('YII_ENV') === 'production';
+        // 测试 / 正式各写死 3 家;shopId 请换成真实 xhShop.id(ptStyle=1)
+        $rows = $isProd
+            ? [
+                [
+                    'shopId' => 4458,
+                    'name' => '花语鲜花店',
+                    'address' => '北京市朝阳区望京街道广顺北大街33号',
+                    'businessHours' => '09:00-22:00',
+                    'cover' => 'hhb/images/guest/shop1.jpg',
+                ],
+                [
+                    'shopId' => 4458,
+                    'name' => '初见花艺',
+                    'address' => '北京市朝阳区望京SOHO塔1-B座底商',
+                    'businessHours' => '09:00-22:00',
+                    'cover' => 'hhb/images/guest/shop2.jpg',
+                ],
+                [
+                    'shopId' => 4458,
+                    'name' => '拾光花坊',
+                    'address' => '北京市朝阳区利泽西街6号院底商',
+                    'businessHours' => '09:00-22:00',
+                    'cover' => 'hhb/images/guest/shop3.jpg',
+                ],
+            ]
+            : [
+                [
+                    'shopId' => 36524,
+                    'name' => '花语鲜花店',
+                    'address' => '北京市朝阳区望京街道广顺北大街33号',
+                    'businessHours' => '09:00-22:00',
+                    'cover' => 'hhb/images/guest/shop1.jpg',
+                ],
+                [
+                    'shopId' => 36524,
+                    'name' => '初见花艺',
+                    'address' => '北京市朝阳区望京SOHO塔1-B座底商',
+                    'businessHours' => '09:00-22:00',
+                    'cover' => 'hhb/images/guest/shop2.jpg',
+                ],
+                [
+                    'shopId' => 36524,
+                    'name' => '拾光花坊',
+                    'address' => '北京市朝阳区利泽西街6号院底商',
+                    'businessHours' => '09:00-22:00',
+                    'cover' => 'hhb/images/guest/shop3.jpg',
+                ],
+            ];
+
+        $list = [];
+        foreach ($rows as $row) {
+            $shopId = (int)($row['shopId'] ?? 0);
+            $list[] = [
+                'shopId' => $shopId,
+                'account' => $shopId,
+                'id' => $shopId,
+                'name' => (string)($row['name'] ?? ''),
+                'address' => (string)($row['address'] ?? ''),
+                'businessHours' => (string)($row['businessHours'] ?? ''),
+                'cover' => imgUtil::groupImg($row['cover'] ?? ''),
+                'avatar' => imgUtil::groupImg($row['cover'] ?? ''),
+            ];
+        }
+
+        util::success([
+            'banner' => imgUtil::groupImg('hhb/images/guest/banner.jpg'),
+            'list' => $list,
+        ]);
+    }
+
+    /**
+     * 未登录首页按花店名称搜索(xhShop.ptStyle=1 零售花店)
+     * 仅匹配 shopName / merchantName,不按城市搜
+     */
+    public function actionSearch()
+    {
+        $keyword = trim((string)Yii::$app->request->get('keyword', ''));
+        if ($keyword === '') {
+            util::success(['list' => []]);
+        }
+        // 限制长度,避免超长 like 拖垮查询
+        if (mb_strlen($keyword) > 30) {
+            $keyword = mb_substr($keyword, 0, 30);
+        }
+
+        $ptStyle = (int)dict::getDict('ptStyle', 'hd'); // 1=零售花店
+        $rows = \biz\shop\models\Shop::find()
+            ->select(['id', 'shopName', 'merchantName', 'city', 'address', 'floor', 'avatar', 'openStartTime', 'openEndTime', 'open'])
+            ->where(['ptStyle' => $ptStyle])
+            ->andWhere([
+                'or',
+                ['like', 'shopName', $keyword],
+                ['like', 'merchantName', $keyword],
+            ])
+            ->orderBy(['id' => SORT_DESC])
+            ->limit(30)
+            ->asArray()
+            ->all();
+
+        $list = [];
+        foreach ($rows as $row) {
+            $shopName = trim((string)($row['shopName'] ?? ''));
+            $merchantName = trim((string)($row['merchantName'] ?? ''));
+            // 展示名:首店只显示商家名,否则「商家名 店名」
+            $name = ($shopName === '' || $shopName === '首店')
+                ? ($merchantName !== '' ? $merchantName : $shopName)
+                : ($merchantName !== '' ? ($merchantName . ' ' . $shopName) : $shopName);
+            $avatarShort = $row['avatar'] ?? '';
+            $start = trim((string)($row['openStartTime'] ?? ''));
+            $end = trim((string)($row['openEndTime'] ?? ''));
+            $hours = '';
+            if ($start !== '' && $end !== '') {
+                $hours = $start . '-' . $end;
+            }
+            $list[] = [
+                'id' => (int)$row['id'],
+                'account' => (int)$row['id'],
+                'name' => $name,
+                'address' => trim(($row['city'] ?? '') . ($row['address'] ?? '') . ($row['floor'] ?? '')),
+                'avatar' => empty($avatarShort)
+                    ? ''
+                    : imgUtil::groupImg($avatarShort) . '?x-oss-process=image/resize,m_fill,h_200,w_200',
+                'businessHours' => $hours,
+                'open' => isset($row['open']) ? (int)$row['open'] : 1,
+            ];
+        }
+        util::success(['list' => $list]);
+    }
 
     //门店详情 ssh 20230210
     public function actionInfo()

+ 24 - 5
biz-hd/order/classes/PsMethodClass.php

@@ -52,7 +52,7 @@ class PsMethodClass extends BaseClass
     }
 
     /**
-     * 获取指定配送方式的配置(不存在则按字典默认初始化)
+     * 获取指定配送方式的配置(不存在则按字典 psMethod 默认初始化)
      * @param int $shopId 门店ID
      * @param int $mainId 商户ID
      * @param int $style 配送类型 0-4
@@ -60,10 +60,10 @@ class PsMethodClass extends BaseClass
      */
     public static function getConfig($shopId, $mainId, $style)
     {
-        // 复杂分支/关键逻辑:按 mainId + style 查 xhPsMethod,无记录则写入默认配置
+        // 无记录时按 dict.psMethod 写入:新店默认仅跑腿(自定义)+自取启用
         $config = self::getByCondition(['mainId' => $mainId, 'style' => $style]);
         if (empty($config)) {
-            $defaultConfig = dict::getDict('shMethod', $style);
+            $defaultConfig = dict::getDict('psMethod', $style);
 
             $initData = array_merge([
                 'shopId' => $shopId,
@@ -94,6 +94,23 @@ class PsMethodClass extends BaseClass
         return $config;
     }
 
+    /**
+     * 新店开店时初始化五种 xhPsMethod(按 dict.psMethod,仅缺的 style 才插入)
+     * 谁用:ShopClass::addShop;保证注册当下落库,不必等首次打开配送设置
+     * @param int $shopId
+     * @param int $mainId
+     * @return void
+     */
+    public static function initDefaultMethods($shopId, $mainId)
+    {
+        $shopId = (int)$shopId;
+        $mainId = (int)$mainId;
+        if ($shopId <= 0 || $mainId <= 0) {
+            return;
+        }
+        self::getAllConfigs($shopId, $mainId);
+    }
+
     /**
      * 客户 homeRule=1 时,用 xhCustom/xhHd 上的送货上门字段覆盖 style=0 配置
      * @param array $config xhPsMethod 送货配置
@@ -118,6 +135,7 @@ class PsMethodClass extends BaseClass
 
     /**
      * 一次性获取商户全部配送方式配置(含 xhPsExplain / xhPsReduceRule)
+     * 缺哪种 style 就按 dict.psMethod 补齐写入 xhPsMethod
      * @param int $shopId 门店ID
      * @param int $mainId 商户ID
      * @return array
@@ -126,9 +144,10 @@ class PsMethodClass extends BaseClass
     {
         $configsMap = self::getAllByCondition(['mainId' => $mainId], 'sort asc', '*', 'style', true);
 
+        // 补齐缺失 style:新店默认仅跑腿+自取启用,见 dict.psMethod
         for ($style = 0; $style <= 4; $style++) {
             if (!isset($configsMap[$style])) {
-                $defaultConfig = dict::getDict('shMethod', $style);
+                $defaultConfig = dict::getDict('psMethod', $style);
                 $initData = array_merge([
                     'shopId' => $shopId,
                     'mainId' => $mainId,
@@ -435,7 +454,7 @@ class PsMethodClass extends BaseClass
                 $saveData['shopId'] = $shopId;
                 $saveData['mainId'] = $mainId;
                 $saveData['style'] = $style;
-                $defaultConfig = dict::getDict('shMethod', $style);
+                $defaultConfig = dict::getDict('psMethod', $style);
                 if (!empty($defaultConfig['originName'])) {
                     $saveData['originName'] = $defaultConfig['originName'];
                 }

+ 114 - 15
biz-hd/refund/classes/HdRefundMallClass.php

@@ -3,6 +3,8 @@
  * 用途:商城顾客售后申请(落 xhHdRefund 待审核)
  * 谁用:app-mall RefundController 提交/列表/撤销、app-hd RefundController 审核通过/驳回
  * 解决:申请只落待审核记录不动资金库存;审核通过时复用 HdRefundService 执行真实退款
+ * 退货并退款金额:普通商品按勾选原价分摊会员折/满减/红包(跑腿费不参与分摊);秒杀、团购按活动单价退
+ * 审核通过后退红包:现金已退清(含隔天 nextDayTkPrice)或商品/花材已全部退完,不依赖前端 refundHb
  */
 
 namespace bizHd\refund\classes;
@@ -319,6 +321,7 @@ class HdRefundMallClass
 
     /**
      * 退货并退款应退金额:秒杀/团购按行上活动单价;普通商品再按整单优惠占比扣除会员折、满减、红包
+     * 跑腿费不参与分摊,与 mallApp refund.vue、下单 wholeDiscount 口径一致
      * @param array $productList 已用订单行单价、seckillGoodsId 补齐的勾选商品
      * @param object $order xhOrder
      * @return float 不超过可退上限的应退金额
@@ -342,18 +345,7 @@ class HdRefundMallClass
             }
         }
 
-        $hbAmount = self::toMoney($order->hbAmount ?? 0);
-        $prePrice = self::toMoney($order->prePrice ?? 0);
-        if (bccomp($prePrice, '0', 2) > 0) {
-            $allocBase = bcadd($prePrice, $hbAmount, 2);
-        } else {
-            $allocBase = self::toMoney($order->goodsPrice ?? 0);
-            $allocBase = bcadd($allocBase, self::toMoney($order->sendCost ?? 0), 2);
-            $allocBase = bcadd($allocBase, self::toMoney($order->packingFee ?? 0), 2);
-            $allocBase = bcadd($allocBase, self::toMoney($order->labourCost ?? 0), 2);
-            $allocBase = bcadd($allocBase, self::toMoney($order->serviceFee ?? 0), 2);
-        }
-
+        $allocBase = self::getDiscountAllocBase($order);
         $activityOriginal = self::sumOrderActivityOriginal($order, $isGroupBuy);
         $normalBase = (float)$allocBase - (float)$activityOriginal;
         if ($normalBase < 0) {
@@ -362,7 +354,7 @@ class HdRefundMallClass
 
         $discountTotal = self::toMoney($order->discountAmount ?? 0);
         $discountTotal = bcadd($discountTotal, self::toMoney($order->orderReachDiscountPrice ?? 0), 2);
-        $discountTotal = bcadd($discountTotal, $hbAmount, 2);
+        $discountTotal = bcadd($discountTotal, self::toMoney($order->hbAmount ?? 0), 2);
 
         $normalPrice = $selectedNormal;
         if ($selectedNormal > 0 && $normalBase > 0 && (float)$discountTotal > 0) {
@@ -380,6 +372,49 @@ class HdRefundMallClass
         return round((float)$price, 2);
     }
 
+    /**
+     * 跑腿费(sendType=2 的 sendCost):下单时红包不抵运费、会员折/满减也不打在跑腿费上
+     * 退货分摊时要从基数里剔除,否则会把优惠摊到跑腿费上,商品应退被抬高
+     * @param object $order xhOrder
+     * @return string 两位小数字符串
+     */
+    protected static function getRunnerSendCost($order)
+    {
+        if ((int)($order->sendType ?? 0) !== 2) {
+            return '0.00';
+        }
+        return self::toMoney($order->sendCost ?? 0);
+    }
+
+    /**
+     * 整单优惠分摊基数:红包只抵商品;会员折/满减按「商品+非跑腿运费/包装-红包」
+     * prePrice 已扣红包且含跑腿费,这里加回红包再剔除跑腿费,与下单 wholeDiscount 口径一致
+     * @param object $order xhOrder
+     * @return string 两位小数字符串
+     */
+    protected static function getDiscountAllocBase($order)
+    {
+        $hbAmount = self::toMoney($order->hbAmount ?? 0);
+        $prePrice = self::toMoney($order->prePrice ?? 0);
+        $runnerCost = self::getRunnerSendCost($order);
+        if (bccomp($prePrice, '0', 2) > 0) {
+            $base = bcsub(bcadd($prePrice, $hbAmount, 2), $runnerCost, 2);
+            if (bccomp($base, '0', 2) < 0) {
+                return '0.00';
+            }
+            return $base;
+        }
+        $allocBase = self::toMoney($order->goodsPrice ?? 0);
+        // 非跑腿才把运费计入分摊基数;跑腿费已在 getRunnerSendCost 口径下排除
+        if ((int)($order->sendType ?? 0) !== 2) {
+            $allocBase = bcadd($allocBase, self::toMoney($order->sendCost ?? 0), 2);
+        }
+        $allocBase = bcadd($allocBase, self::toMoney($order->packingFee ?? 0), 2);
+        $allocBase = bcadd($allocBase, self::toMoney($order->labourCost ?? 0), 2);
+        $allocBase = bcadd($allocBase, self::toMoney($order->serviceFee ?? 0), 2);
+        return $allocBase;
+    }
+
     /**
      * 整单秒杀/团购商品原价合计,供从优惠分摊基数中剔除
      * @param object $order
@@ -601,14 +636,78 @@ class HdRefundMallClass
             }
         }
 
-        $updatedOrder = OrderClass::getById($order->id, true, 'id, actPrice, hbId, hbAmount');
-        if (!empty($updatedOrder) && (int)$updatedOrder->hbId > 0 && bccomp((string)$updatedOrder->actPrice, '0', 2) <= 0) {
+        $updatedOrder = OrderClass::getById($order->id, true);
+        if (self::shouldReturnHbAfterApprove($updatedOrder)) {
             HbClass::hbBackIfNotExpired($updatedOrder);
         }
 
         return $refund;
     }
 
+    /**
+     * 审核通过后是否退回红包。与商家端即时售后的 refundHb 勾选无关,由服务端自行判断:
+     * 1)现金已退清:remainRefundCash=0(当天 tkPrice + 隔天 nextDayTkPrice >= orderPrice)
+     *    不能只看 actPrice——隔天售后只加 nextDayTkPrice、不扣 actPrice,全额退完 actPrice 仍可能 >0
+     * 2)商品/花材已全部退完:红包只抵商品,退货并退款退光商品后即使还留跑腿费也应退红包
+     * @param object|null $order 审核写完金额后的订单
+     * @return bool
+     */
+    protected static function shouldReturnHbAfterApprove($order)
+    {
+        if (empty($order) || (int)($order->hbId ?? 0) <= 0) {
+            return false;
+        }
+        if (bccomp(self::remainRefundCash($order), '0', 2) === 0) {
+            return true;
+        }
+        return self::isAllOrderProductsReturned($order);
+    }
+
+    /**
+     * 订单商品和花材是否都已退完(refundNum >= num)
+     * 只退款不写退货数量时返回 false,避免把部分退款误判成全额退货
+     * @param object $order
+     * @return bool
+     */
+    protected static function isAllOrderProductsReturned($order)
+    {
+        $orderSn = trim((string)($order->orderSn ?? ''));
+        if ($orderSn === '') {
+            return false;
+        }
+        $goodsRows = OrderGoodsClass::getAllByCondition(['orderSn' => $orderSn]) ?: [];
+        $itemRows = OrderItemClass::getAllByCondition(['orderSn' => $orderSn]) ?: [];
+        if (empty($goodsRows) && empty($itemRows)) {
+            return false;
+        }
+        foreach ($goodsRows as $goods) {
+            if (!self::isLineFullyReturned($goods)) {
+                return false;
+            }
+        }
+        foreach ($itemRows as $item) {
+            if (!self::isLineFullyReturned($item)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    /**
+     * 单行是否已退完数量
+     * @param array|object $line 订单商品或花材行
+     * @return bool
+     */
+    protected static function isLineFullyReturned($line)
+    {
+        $num = is_array($line) ? ($line['num'] ?? 0) : ($line->num ?? 0);
+        $refundNum = is_array($line) ? ($line['refundNum'] ?? 0) : ($line->refundNum ?? 0);
+        if (!is_numeric($num) || bccomp((string)$num, '0', 2) <= 0) {
+            return true;
+        }
+        return bccomp((string)$refundNum, (string)$num, 2) >= 0;
+    }
+
     /**
      * 商家驳回申请
      * @param object $refund

+ 4 - 0
biz-hd/shop/classes/ShopClass.php

@@ -8,6 +8,7 @@ use bizHd\admin\classes\AdminClass;
 use bizHd\goods\classes\CategoryClass;
 use bizHd\goods\classes\GoodsSettingClass;
 use bizHd\merchant\classes\SjClass;
+use bizHd\order\classes\PsMethodClass;
 use bizHd\saas\classes\ApplyClass;
 use common\components\dict;
 use common\components\imgUtil;
@@ -213,6 +214,9 @@ class ShopClass extends BaseClass
         $setData = ['mainId' => $mainId, 'riseType' => 0, 'riseAmount' => 0];
         GoodsSettingClass::add($setData);
 
+        // 配送方式默认:跑腿(自定义计费)位置1 + 自取位置2,其余禁用
+        PsMethodClass::initDefaultMethods($newShopId, $mainId);
+
         //初始化员工和角色
         $adminId = $data['adminId'] ?? 0;
         $mobile = $data['mobile'] ?? 0;

+ 100 - 0
common/components/dict.php

@@ -97,6 +97,106 @@ class dict
                 'changeRate' => 0.00
             ],
         ],
+        // 花店配送方式默认配置(xhPsMethod):与 ghs shMethod 独立,新店注册/首次拉配置时写入
+        // 默认仅启用跑腿(用自定义计费)+自取;送货/物流/快递禁用
+        'psMethod' => [
+            0 => [
+                'name' => '送货',
+                'originName' => '送货',
+                'calcType' => 0,
+                'status' => 0,
+                'sort' => 3,
+                'minAmount' => 0.00,
+                'minNum' => 0,
+                'unMeet' => 0,
+                'unMeetFee' => 0.00,
+                'unMeetLockType' => 0,
+                'unMeetLockSeconds' => 1800,
+                'startKm' => 0.00,
+                'startPrice' => 0.00,
+                'perKmPrice' => 0.00,
+                'changeRate' => 0.00,
+                'hsFreeKm' => 0.00,
+                'hsPerKmPrice' => 0.00,
+            ],
+            1 => [
+                'name' => '自取',
+                'originName' => '自取',
+                'calcType' => 0,
+                'status' => 1,
+                'sort' => 2,
+                'minAmount' => 0.00,
+                'minNum' => 0,
+                'unMeet' => 0,
+                'unMeetFee' => 0.00,
+                'unMeetLockType' => 0,
+                'unMeetLockSeconds' => 1800,
+                'startKm' => 0.00,
+                'startPrice' => 0.00,
+                'perKmPrice' => 0.00,
+                'changeRate' => 0.00,
+                'hsFreeKm' => 0.00,
+                'hsPerKmPrice' => 0.00,
+            ],
+            2 => [
+                'name' => '跑腿',
+                'originName' => '跑腿',
+                // 新店默认用自定义计费,避免未绑定跑腿商户无法下单
+                'calcType' => 1,
+                'status' => 1,
+                'sort' => 1,
+                'minAmount' => 0.00,
+                'minNum' => 0,
+                'unMeet' => 0,
+                'unMeetFee' => 0.00,
+                'unMeetLockType' => 0,
+                'unMeetLockSeconds' => 1800,
+                'startKm' => 5.00,
+                'startPrice' => 15.00,
+                'perKmPrice' => 3.00,
+                'changeRate' => 0.00,
+                'hsFreeKm' => 0.00,
+                'hsPerKmPrice' => 0.00,
+            ],
+            3 => [
+                'name' => '物流',
+                'originName' => '物流',
+                'calcType' => 0,
+                'status' => 0,
+                'sort' => 5,
+                'minAmount' => 0.00,
+                'minNum' => 0,
+                'unMeet' => 0,
+                'unMeetFee' => 0.00,
+                'unMeetLockType' => 0,
+                'unMeetLockSeconds' => 1800,
+                'startKm' => 0.00,
+                'startPrice' => 0.00,
+                'perKmPrice' => 0.00,
+                'changeRate' => 0.00,
+                'hsFreeKm' => 0.00,
+                'hsPerKmPrice' => 0.00,
+            ],
+            4 => [
+                'name' => '快递',
+                'originName' => '快递',
+                'calcType' => 0,
+                'status' => 0,
+                'sort' => 4,
+                'minAmount' => 0.00,
+                'minNum' => 0,
+                'unMeet' => 0,
+                'unMeetFee' => 0.00,
+                'unMeetLockType' => 0,
+                'unMeetLockSeconds' => 1800,
+                'startKm' => 0.00,
+                'startPrice' => 0.00,
+                'perKmPrice' => 0.00,
+                'changeRate' => 0.00,
+                'hsFreeKm' => 0.00,
+                'hsPerKmPrice' => 0.00,
+            ],
+        ],
         //APP通知打开关闭状态 1打开 0关闭
         'appNotice' => 1,
         //微信通知打开关闭状态 1打开 0关闭

+ 5 - 8
sql/20260706_redesign.sql

@@ -107,7 +107,7 @@ CREATE TABLE IF NOT EXISTS `xhDistributionUser` (
     `availDeposit` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '可存入分红余额(已结算未存入)',
     `upOrderCount` int(11) NOT NULL DEFAULT '0' COMMENT '为上级贡献订单数(本人下单产生)',
     `upOrderAmount` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '为上级贡献订单金额(计佣基数合计)',
-    `upCommissionAmount` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '为上级贡献提成金额';
+    `upCommissionAmount` decimal(12,2) NOT NULL DEFAULT '0.00' COMMENT '为上级贡献提成金额',
     `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '1正常 0禁用',
     `addTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
     `updateTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
@@ -352,9 +352,9 @@ CREATE TABLE IF NOT EXISTS `xhMainInviteCommission` (
     `commissionSn` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分佣单号(如 FY202607210001)',
     `inviterMainId` int(11) NOT NULL DEFAULT '0' COMMENT '获佣人中央 id(批发商 xhMain.id)',
     `pfShopId` int(11) NOT NULL DEFAULT '0' COMMENT '批发店shopId',
-    `pfShopName` varchar(100) NOT NULL DEFAULT '0' COMMENT '批发店名称',
+    `pfShopName` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0' COMMENT '批发店名称',
     `lsShopId` int(11) NOT NULL DEFAULT '0' COMMENT '零售店shopId',
-    `lsShopName` varchar(100) NOT NULL DEFAULT '0' COMMENT '批发店名称',
+    `lsShopName` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0' COMMENT '批发店名称',
     `inviterShopName` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '获佣人门店名(快照)',
     `inviteeMainId` int(11) NOT NULL DEFAULT '0' COMMENT '受邀花店中央 id(xhMain.id)',
     `inviteeShopName` varchar(80) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '受邀花店名(快照)',
@@ -377,10 +377,7 @@ CREATE TABLE IF NOT EXISTS `xhMainInviteCommission` (
     `updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
     PRIMARY KEY (`id`) USING BTREE,
     UNIQUE KEY `uk_commissionSn` (`commissionSn`) USING BTREE,
-    KEY `idx_inviter_settle_occur` (`inviterMainId`, `settleStatus`, `occurTime`) USING BTREE,
-    KEY `idx_invitee_occur` (`inviteeShopId`, `occurTime`) USING BTREE,
-    KEY `idx_inviteCode` (`inviteCode`) USING BTREE,
-    KEY `idx_relateOrderId` (`relateOrderId`) USING BTREE
+    KEY `idx_inviter_settle_occur` (`inviterMainId`,`settleStatus`) USING BTREE
     ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='门店邀请记录';
 
 CREATE TABLE IF NOT EXISTS `xhMainInviteFlow` (
@@ -413,7 +410,7 @@ ALTER TABLE `xhRenew`
 
 -- xhShopExt 表添加客服电话与微信二维码
 ALTER TABLE xhShopExt
-  ADD COLUMN serviceMobile varchar(20) NOT NULL DEFAULT '' COMMENT '客服电话' AFTER rechargeRemark,
+  ADD COLUMN serviceMobile varchar(20) NOT NULL DEFAULT '' COMMENT '客服电话' AFTER reachVip,
   ADD COLUMN serviceWx varchar(300) NOT NULL DEFAULT '' COMMENT '客服微信二维码' AFTER serviceMobile;
 
 CREATE TABLE IF NOT EXISTS `xhMainWalletRecharge` (