Parcourir la source

优化用户下单方法-进行中

sunxbiao il y a 1 an
Parent
commit
e7fdee0fa9

+ 105 - 3
app/common/enum/CommonEnum.php

@@ -36,6 +36,16 @@ class CommonEnum
36 36
         'XingfuXiaodian' => ['code' => 2001, 'name' => '幸福小店'],
37 37
     ];
38 38
 
39
+    const USER_GROUP = [
40
+        'RegularUser' => ['code' => 1, 'name' => '普通用户'],
41
+        'Salesperson' => ['code' => 2, 'name' => '业务员'],
42
+        'SalesManager' => ['code' => 3, 'name' => '业务经理'],
43
+        'JuniorPartner' => ['code' => 4, 'name' => '初级合伙人'],
44
+        'Mid-LevelPartner' => ['code' => 5, 'name' => '中级合伙人'],
45
+        'SeniorPartner' => ['code' => 6, 'name' => '中级合伙人'],
46
+        'Director' => ['code' => 7, 'name' => '董事']
47
+    ];
48
+
39 49
     // 直推奖励的分配比例
40 50
     const DIRECT_REFERRAL_BONUS = [
41 51
         'BrokeragePrice' => ['code' => 0.9, 'name' => '直推奖励的佣金部分'],
@@ -52,6 +62,76 @@ class CommonEnum
52 62
         // 精彩生活区
53 63
         'WonderfulLiving' => [
54 64
             'Self' => [
65
+                'YangLaoJin' => [ // 钱
66
+                    'Ratio' => ['code' => 0.3, 'name' => '将利润的30%,当做养老金分配给下单人']
67
+                ],
68
+                'Hongbao' => [ // 钱
69
+                    'Ratio' => ['code' => 0.1575, 'name' => '将利润的35% * 45%,当做红包分配给下单人,前提下单人是老用户(35% * 45%)']
70
+                ],
71
+                'Score' => [ // 钱
72
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做积分值分配给下单人']
73
+                ],
74
+                'Pv' => [ // 数据 算业绩
75
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做PV值分配给下单人']
76
+                ],
77
+                'Gongxian' => [ // 数据 升级用
78
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做贡献值分配给下单人']
79
+                ]
80
+            ],
81
+            'Spread' => [
82
+                'Basics' => [
83
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做推荐人利润分配的基础,目前绑定的是下单人的PV值']
84
+                ],
85
+                'BrokeragePrice' => [
86
+                    'Ratio' => ['code' => 0.9, 'name' => '直推奖励的佣金部分'],
87
+                ],
88
+                'Fugou' => [
89
+                    'Ratio' => ['code' => 0.1, 'name' => '直推奖励的复购部分'],
90
+                ],
91
+                'Gongxian' => [
92
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做贡献值分配给推荐人']
93
+                ],
94
+                'Score' => [
95
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做积分值分配给推荐人']
96
+                ],
97
+                'YangLaoJin' => [
98
+                    'Ratio' => ['code' => 0.05, 'name' => '将利润的35%,当做积分值分配给推荐人']
99
+                ]
100
+            ],
101
+            'Share' => [
102
+                'Basics' => [
103
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做分享人利润分配的基础,目前绑定的是下单人的PV值']
104
+                ],
105
+                'BrokeragePrice' => [
106
+                    'Ratio' => ['code' => 0.027, 'name' => '分享奖励的佣金部分(0.03 * 0.9)'],
107
+                ],
108
+                'Fugou' => [
109
+                    'Ratio' => ['code' => 0.003, 'name' => '分享奖励的复购部分(0.03 * 0.1)'],
110
+                ]
111
+            ],
112
+            'Lock' => [
113
+                'Basics' => [
114
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做锁客利润分配的基础,目前绑定的是下单人的PV值']
115
+                ],
116
+                'BrokeragePrice' => [
117
+                    'Ratio' => ['code' => 0.045, 'name' => '锁客奖励的佣金部分(0.05 * 0.9)'],
118
+                ],
119
+                'Fugou' => [
120
+                    'Ratio' => ['code' => 0.005, 'name' => '锁客奖励的复购部分(0.05 * 0.1)'],
121
+                ]
122
+            ]
123
+        ],
124
+        'MemberZone' => [
125
+            'Fixed' => [
126
+                'Basic' => [ // 售价 => 基础计算价格
127
+                    1180 => 1000,
128
+                    2360 => 2000,
129
+                    9440 => 8000,
130
+                    10620 => 9000,
131
+                    11800 => 10000
132
+                ]
133
+            ],
134
+            'Self' => [
55 135
                 // 养老金比例
56 136
                 'YangLaoJin' => [
57 137
                     'Ratio' => ['code' => 0.3, 'name' => '将利润的30%,当做养老金分配给下单人']
@@ -73,11 +153,11 @@ class CommonEnum
73 153
                 'Basics' => [
74 154
                     'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做推荐人利润分配的基础,目前绑定的是下单人的PV值']
75 155
                 ],
76
-                'BrokeragePrice' =>[
156
+                'BrokeragePrice' => [
77 157
                     'Ratio' => ['code' => 0.9, 'name' => '直推奖励的佣金部分'],
78 158
                 ],
79
-                'Fugou' =>[
80
-                    'Ratio' => ['code' => 0.1, 'name' => '直推奖励的佣金部分'],
159
+                'Fugou' => [
160
+                    'Ratio' => ['code' => 0.1, 'name' => '直推奖励的复购部分'],
81 161
                 ],
82 162
                 'Gongxian' => [
83 163
                     'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做贡献值分配给推荐人']
@@ -85,6 +165,28 @@ class CommonEnum
85 165
                 'Score' => [
86 166
                     'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做积分值分配给推荐人']
87 167
                 ]
168
+            ],
169
+            'Share' => [
170
+                'Basics' => [
171
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做分享人利润分配的基础,目前绑定的是下单人的PV值']
172
+                ],
173
+                'BrokeragePrice' => [
174
+                    'Ratio' => ['code' => 0.027, 'name' => '分享奖励的佣金部分(0.03 * 0.9)'],
175
+                ],
176
+                'Fugou' => [
177
+                    'Ratio' => ['code' => 0.003, 'name' => '分享奖励的复购部分(0.03 * 0.1)'],
178
+                ]
179
+            ],
180
+            'Lock' => [
181
+                'Basics' => [
182
+                    'Ratio' => ['code' => 0.35, 'name' => '将利润的35%,当做锁客利润分配的基础,目前绑定的是下单人的PV值']
183
+                ],
184
+                'BrokeragePrice' => [
185
+                    'Ratio' => ['code' => 0.045, 'name' => '锁客奖励的佣金部分(0.05 * 0.9)'],
186
+                ],
187
+                'Fugou' => [
188
+                    'Ratio' => ['code' => 0.005, 'name' => '锁客奖励的复购部分(0.05 * 0.1)'],
189
+                ]
88 190
             ]
89 191
         ]
90 192
 

+ 53 - 1
app/common/enum/merchant/MerchantEnum.php

@@ -6,5 +6,57 @@ use app\common\enum\CommonEnum;
6 6
 
7 7
 class MerchantEnum extends CommonEnum
8 8
 {
9
+    // 商户类型
10
+    const MER_TYPE = [
11
+        'Normal' => ['code' => 0, 'name' => '普通商户'],
12
+        'Tea' => ['code' => 1, 'name' => '一壶茶'],
13
+    ];
9 14
 
10
-}
15
+    // 商户级别
16
+    const MERCHANT_LEVEL = [
17
+        'Low' => ['code' => 0, 'name' => '低级商户'],
18
+        'High' => ['code' => 1, 'name' => '高级商户'],
19
+    ];
20
+
21
+    // 是否体验店
22
+    const IS_EXPERIENCE = [
23
+        'No' => ['code' => 0, 'name' => '否'],
24
+        'Yes' => ['code' => 1, 'name' => '是'],
25
+    ];
26
+
27
+    // 是否连锁店
28
+    const MER_CHAIN = [
29
+        'No' => ['code' => 0, 'name' => '不是'],
30
+        'Yes' => ['code' => 1, 'name' => '是'],
31
+    ];
32
+
33
+    // 是否已缴纳保证金
34
+    const BZJ = [
35
+        'No' => ['code' => 0, 'name' => '否'],
36
+        'Yes' => ['code' => 1, 'name' => '是'],
37
+    ];
38
+
39
+    // 商户状态
40
+    const MER_STATE = [
41
+        'Open' => ['code' => 1, 'name' => '开启'],
42
+        'Close' => ['code' => 0, 'name' => '关闭'],
43
+    ];
44
+
45
+    // 商户审核状态
46
+    const IS_AUDIT = [
47
+        'NotAudited' => ['code' => 0, 'name' => '不审核'],
48
+        'Audited' => ['code' => 1, 'name' => '审核'],
49
+    ];
50
+
51
+    // 海科商户结算状态
52
+    const HAIKE_SETTLE_STATUS = [
53
+        'NotSettled' => ['code' => '0', 'name' => '未结算'],
54
+        'Settled' => ['code' => '1', 'name' => '已结算'],
55
+    ];
56
+
57
+    // 商户是否禁用
58
+    const STATUS = [
59
+        'Locked' => ['code' => 0, 'name' => '锁定'],
60
+        'Normal' => ['code' => 1, 'name' => '正常'],
61
+    ];
62
+}

+ 6 - 0
app/common/enum/store/StoreOrderEnum.php

@@ -106,4 +106,10 @@ class StoreOrderEnum extends CommonEnum
106 106
         'NO' => ['code' => 0, 'name' => '未支付'],
107 107
         'YES' => ['code' => 1, 'name' => '已支付'],
108 108
     ];
109
+
110
+    // 是否已结算 is_settlement
111
+    const IS_SETTLEMENT = [
112
+        'NO' => ['code' => 0, 'name' => '未结算'],
113
+        'YES' => ['code' => 1, 'name' => '已结算'],
114
+    ];
109 115
 }

+ 112 - 11
app/common/repositories/store/order/StoreOrderRepository.php

@@ -11266,8 +11266,12 @@ class StoreOrderRepository extends BaseRepository
11266 11266
         return $storeOrderEntity;
11267 11267
     }
11268 11268
 
11269
-    public function createCommissionByStoreOrderEntity(StoreOrderEntity $storeOrderEntity)
11269
+    public function createCommissionByStoreOrderEntity(int $orderId)
11270 11270
     {
11271
+        /** @var StoreOrderRepository $storeOrderRepository */
11272
+        $storeOrderRepository = app()->make(StoreOrderRepository::class);
11273
+        $storeOrderEntity = $storeOrderRepository->getStoreOrderEntityByOrderId($orderId);
11274
+
11271 11275
         /** @var UserRepository $userRepository */
11272 11276
         $userRepository = app()->make(UserRepository::class);
11273 11277
         $userEntity = $userRepository->getUserEntityByUid($storeOrderEntity->getUid());
@@ -11276,12 +11280,12 @@ class StoreOrderRepository extends BaseRepository
11276 11280
         }
11277 11281
 
11278 11282
         // 精彩生活区
11279
-        if ($storeOrderEntity->getMerId() == CommonEnum::DESIGN_MERCHANT_ID['WonderfulLiving']['Self']['code']) {
11283
+        if ($storeOrderEntity->getMerId() == CommonEnum::DESIGN_MERCHANT_ID['WonderfulLiving']['code']) {
11280 11284
             // 为消费者 初始化 添加养老金记录
11281 11285
             $yanglaojin = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11282 11286
             /** @var UserBillRepository $userBillRepository */
11283 11287
             $userBillRepository = app()->make(UserBillRepository::class);
11284
-            $userBillEntity = $userBillRepository->addUserBill(
11288
+            $userBillRepository->addUserBill(
11285 11289
                 $storeOrderEntity->getUid(),
11286 11290
                 UserBillEnum::TYPE_SHOP['Platform']['code'],
11287 11291
                 $storeOrderEntity->getOrderId(),
@@ -11294,7 +11298,7 @@ class StoreOrderRepository extends BaseRepository
11294 11298
             $gongxian = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['Gongxian']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11295 11299
             /** @var UserSignGongxianRepository $userSignGongxianRepository */
11296 11300
             $userSignGongxianRepository = app()->make(UserSignGongxianRepository::class);
11297
-            $userSignGongxianEntity = $userSignGongxianRepository->addUserSingGongxian(
11301
+            $userSignGongxianRepository->addUserSingGongxian(
11298 11302
                 $storeOrderEntity->getUid(),
11299 11303
                 UserSignGongxianEnum::TYPE['Give']['code'],
11300 11304
                 $gongxian,
@@ -11307,7 +11311,7 @@ class StoreOrderRepository extends BaseRepository
11307 11311
             $pv = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['Pv']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11308 11312
             /** @var UserPvLogRepository $userPvLogRepository */
11309 11313
             $userPvLogRepository = app()->make(UserPvLogRepository::class);
11310
-            $userPvLogEntity = $userPvLogRepository->addUserPvLog(
11314
+            $userPvLogRepository->addUserPvLog(
11311 11315
                 $storeOrderEntity->getUid(),
11312 11316
                 $pv,
11313 11317
                 '购买精彩生活商品赠送PV值',
@@ -11329,7 +11333,7 @@ class StoreOrderRepository extends BaseRepository
11329 11333
                 $storeOrderEntity->getOrderId()
11330 11334
             );
11331 11335
 
11332
-            // 给老用户的奖励
11336
+            // 给老用户的奖励 红包
11333 11337
             if ($userEntity->getIsOld()) {
11334 11338
                 $hongbao =  bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Self']['Hongbao']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11335 11339
                 /** @var UserSignHongbaoRepository $userSignHongbaoRepository */
@@ -11349,12 +11353,12 @@ class StoreOrderRepository extends BaseRepository
11349 11353
                 $userEntityBySpreadUid = $userRepository->getUserEntityByUid($userEntity->getSpreadUid());
11350 11354
                 if (!empty($userEntityBySpreadUid->getUid()) && $userEntityBySpreadUid->getIsDel() == UserEnum::IS_DEL['No']['code']) {
11351 11355
                     // 推荐人 数据分配的 基础值
11352
-                    $basics = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Spread']['Basics']['Ratio']['code'], CommonEnum::CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES);
11356
+                    $basicsBySpread = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Spread']['Basics']['Ratio']['code'], CommonEnum::CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES);
11353 11357
 
11354 11358
                     // 后台设置中 可以设置  直推收益 的比例
11355 11359
                     $rate = static::getUserGroupRate($userEntityBySpreadUid->getUserGroup());
11356 11360
                     // 推荐 奖金 目前需要将 奖金按比例 分成佣金和复购金
11357
-                    $directReferralBonus = bcmul($basics, $rate, CommonEnum::CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES);
11361
+                    $directReferralBonus = bcmul($basicsBySpread, $rate, CommonEnum::CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES);
11358 11362
 
11359 11363
                     // 计算 复购金
11360 11364
                     $fugouBySpreadUid = bcmul($directReferralBonus, CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Spread']['Fugou']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
@@ -11365,7 +11369,7 @@ class StoreOrderRepository extends BaseRepository
11365 11369
                         $userEntityBySpreadUid->getUid(),
11366 11370
                         UserSignFugouEnum::TYPE['Give']['code'],
11367 11371
                         $fugouBySpreadUid,
11368
-                        '用户购买精彩生活区商品',
11372
+                        '推广精彩生活区商品赠送复购金',
11369 11373
                         UserSignFugouEnum::ORDER_TYPE['Platform']['code'],
11370 11374
                         $storeOrderEntity->getOrderId()
11371 11375
                     );
@@ -11381,7 +11385,7 @@ class StoreOrderRepository extends BaseRepository
11381 11385
                         $storeOrderEntity->getOrderId(),
11382 11386
                         UserBillEnum::COMMISSION_TYPE['DIRECT_REFERRAL']['code'],
11383 11387
                         $brokeragePriceBySpreadUid,
11384
-                        '推广获得佣金'
11388
+                        '推广精彩生活区商品赠送佣金'
11385 11389
                     );
11386 11390
 
11387 11391
                     // 初始胡 贡献值
@@ -11413,6 +11417,21 @@ class StoreOrderRepository extends BaseRepository
11413 11417
                         UserSignHongbaoEnum::ORDER_TYPE['Platform']['code'],
11414 11418
                         $storeOrderEntity->getOrderId()
11415 11419
                     );
11420
+
11421
+                    // 如果用户的身份 不是 普通用户 (高于普通用户) 则发放养老金
11422
+                    if ($userEntityBySpreadUid->getUserGroup() != CommonEnum::USER_GROUP['RegularUser']['code']) {
11423
+                        // $basicsBySpread
11424
+                        /** @var UserBillRepository $userBillRepository */
11425
+                        $userBillRepository = app()->make(UserBillRepository::class);
11426
+                        $userBillRepository->addUserBill(
11427
+                            $storeOrderEntity->getUid(),
11428
+                            UserBillEnum::TYPE_SHOP['Platform']['code'],
11429
+                            $storeOrderEntity->getOrderId(),
11430
+                            UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
11431
+                            $yanglaojin,
11432
+                            '消费获得养老金'
11433
+                        );
11434
+                    }
11416 11435
                 }
11417 11436
             }
11418 11437
 
@@ -11420,7 +11439,89 @@ class StoreOrderRepository extends BaseRepository
11420 11439
             if (!empty($storeOrderEntity->getShareUid())) {
11421 11440
                 $userEntityByShareUid = $userRepository->getUserEntityByUid($storeOrderEntity->getShareUid());
11422 11441
                 if (!empty($userEntityByShareUid->getUid()) && $userEntityByShareUid->getIsDel() == UserEnum::IS_DEL['No']['code']) {
11423
-                    
11442
+                    // 分享人人 数据分配的 基础值
11443
+                    $basicsByShare = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Share']['Basics']['Ratio']['code'], CommonEnum::CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES);
11444
+                    // 计算 佣金
11445
+                    $brokeragePriceByShareUid = bcmul($basicsByShare, CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Share']['BrokeragePrice']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11446
+                    // 计算 复购金
11447
+                    $fugouByShareUid = bcmul($basicsByShare, CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Share']['Fugou']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11448
+
11449
+                    // 添加佣金记录
11450
+                    /** @var UserBillRepository $userBillRepository */
11451
+                    $userBillRepository = app()->make(UserBillRepository::class);
11452
+                    $userBillRepository->addUserBill(
11453
+                        $userEntityByShareUid->getUid(),
11454
+                        UserBillEnum::TYPE_SHOP['Platform']['code'],
11455
+                        $storeOrderEntity->getOrderId(),
11456
+                        UserBillEnum::COMMISSION_TYPE['SHARE_EARNINGS']['code'],
11457
+                        $brokeragePriceByShareUid,
11458
+                        '分享精彩生活区商品赠送佣金'
11459
+                    );
11460
+
11461
+                    // 添加复购金记录
11462
+                    /** @var UserSignFugouRepository $userSignFugouRepository */
11463
+                    $userSignFugouRepository = app()->make(UserSignFugouRepository::class);
11464
+                    $userSignFugouRepository->addUserSingFugou(
11465
+                        $userEntityByShareUid->getUid(),
11466
+                        UserSignFugouEnum::TYPE['Give']['code'],
11467
+                        $fugouByShareUid,
11468
+                        '分享精彩生活区商品赠送复购金',
11469
+                        UserSignFugouEnum::ORDER_TYPE['Platform']['code'],
11470
+                        $storeOrderEntity->getOrderId()
11471
+                    );
11472
+                }
11473
+            }
11474
+
11475
+            // 锁客收益
11476
+            if (!empty($userEntity->getMerId())) {
11477
+                /** @var MerchantRepository $merchantRepository */
11478
+                $merchantRepository = app()->make(MerchantRepository::class);
11479
+                $merchantEntity = $merchantRepository->getMerchantEntityByMerchantId($userEntity->getMerId());
11480
+                if ($merchantEntity->getStatus() == MerchantEnum::STATUS['Normal']['code'] && !empty($merchantEntity->getUid())) {
11481
+                    // 锁客 数据分配的 基础值
11482
+                    $basicsByMerId = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Lock']['Basics']['Ratio']['code'], CommonEnum::CALCULATE_THE_NUMBER_OF_DECIMAL_PLACES);
11483
+                    // 计算 佣金
11484
+                    $brokeragePriceByMerId = bcmul($basicsByMerId, CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Lock']['BrokeragePrice']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11485
+                    // 计算 复购金
11486
+                    $fugouByMerId = bcmul($basicsByMerId, CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Lock']['Fugou']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
11487
+
11488
+                    // 添加佣金记录
11489
+                    /** @var UserBillRepository $userBillRepository */
11490
+                    $userBillRepository = app()->make(UserBillRepository::class);
11491
+                    $userBillRepository->addUserBill(
11492
+                        $merchantEntity->getUid(),
11493
+                        UserBillEnum::TYPE_SHOP['Platform']['code'],
11494
+                        $storeOrderEntity->getOrderId(),
11495
+                        UserBillEnum::COMMISSION_TYPE['LOCKED_CUSTOMER']['code'],
11496
+                        $brokeragePriceByMerId,
11497
+                        '锁客佣金(精彩生活区商品赠送)'
11498
+                    );
11499
+
11500
+                    // 添加复购金记录
11501
+                    /** @var UserSignFugouRepository $userSignFugouRepository */
11502
+                    $userSignFugouRepository = app()->make(UserSignFugouRepository::class);
11503
+                    $userSignFugouRepository->addUserSingFugou(
11504
+                        $merchantEntity->getUid(),
11505
+                        UserSignFugouEnum::TYPE['Give']['code'],
11506
+                        $fugouByMerId,
11507
+                        '锁客复购金(精彩生活区商品赠送)',
11508
+                        UserSignFugouEnum::ORDER_TYPE['Platform']['code'],
11509
+                        $storeOrderEntity->getOrderId()
11510
+                    );
11511
+                }
11512
+            }
11513
+        } else if ($storeOrderEntity->getMerId() == CommonEnum::DESIGN_MERCHANT_ID['MemberZone']['code']) {
11514
+            // 由于 会员专区的订单不允许退货 所以支付成功后即 结算数据
11515
+            if ($storeOrderEntity->getPaid() == StoreOrderEnum::PAID['YES']['code']) {
11516
+                // 如果订单已经支付
11517
+
11518
+                // 将 订单 设置成已计算状态
11519
+                try {
11520
+                    $storeOrderRepository->update($storeOrderEntity->getOrderId(), [
11521
+                        'is_settlement' => StoreOrderEnum::IS_SETTLEMENT['YES']['code']
11522
+                    ]);
11523
+                } catch (DbException $e) {
11524
+                    throw new ValidateException('更新订单结算状态失败!');
11424 11525
                 }
11425 11526
             }
11426 11527
         }