Просмотр исходного кода

Merge branch 'dev-rewardPoints' into dev

bianjunhui 3 месяцев назад
Родитель
Сommit
c52aa281d5

+ 5 - 5
packages/Longyi/RewardPoints/src/Console/Commands/InitializeGrowthSettings.php

@@ -61,7 +61,7 @@ class InitializeGrowthSettings extends Command
                 'require_first_order' => false,
                 'growth_level_name' => 'General-V0',
                 'growth_discount_rate' => 0,
-                'growth_benefits' => ['基础会员服务'],
+                'growth_benefits' => json_encode(['基础会员服务']), // 修复:转换为 JSON
                 'growth_level_icon' => null,
             ]);
             $this->info('✓ General group updated with V0 level');
@@ -76,7 +76,7 @@ class InitializeGrowthSettings extends Command
                     'require_first_order' => true,
                     'growth_level_name' => 'V1',
                     'growth_discount_rate' => 2,
-                    'growth_benefits' => ['完成首单升级', '享受2%额外折扣', '优先客服支持'],
+                    'growth_benefits' => json_encode(['完成首单升级', '享受2%额外折扣', '优先客服支持']), // 修复:转换为 JSON
                     'growth_level_icon' => null,
                     'is_user_defined' => 1,
                 ]
@@ -93,7 +93,7 @@ class InitializeGrowthSettings extends Command
                     'require_first_order' => false,
                     'growth_level_name' => 'V2',
                     'growth_discount_rate' => 5,
-                    'growth_benefits' => ['享受5%额外折扣', '专属优惠券', '生日礼品', '优先发货'],
+                    'growth_benefits' => json_encode(['享受5%额外折扣', '专属优惠券', '生日礼品', '优先发货']), // 修复:转换为 JSON
                     'growth_level_icon' => null,
                     'is_user_defined' => 1,
                 ]
@@ -107,7 +107,7 @@ class InitializeGrowthSettings extends Command
                 'require_first_order' => false,
                 'growth_level_name' => 'V3',
                 'growth_discount_rate' => 10,
-                'growth_benefits' => ['享受10%额外折扣', '专属客服经理', '新品优先体验', '免费配送', '专属活动邀请'],
+                'growth_benefits' => json_encode(['享受10%额外折扣', '专属客服经理', '新品优先体验', '免费配送', '专属活动邀请']), // 修复:转换为 JSON
                 'growth_level_icon' => null,
             ]);
             $this->info('✓ Wholesale group updated with V3 level');
@@ -168,6 +168,7 @@ class InitializeGrowthSettings extends Command
             $this->warn('Growth value menu items already exist in dynamic menu.');
             return;
         }
+
         // 创建父级菜单项
         $parentItem = MenuItem::create([
             'name' => '用户管理',
@@ -220,4 +221,3 @@ class InitializeGrowthSettings extends Command
         $this->info('✓ Growth value menu items added to dynamic menu successfully!');
     }
 }
-