|
|
@@ -86,6 +86,7 @@ use app\common\repositories\user\UserSignHongbaoRepository;
|
|
86
|
86
|
use app\common\repositories\user\UserSignJingdouRepository;
|
|
87
|
87
|
use app\common\repositories\user\UserSignScoreRepository;
|
|
88
|
88
|
use app\common\repositories\user\UserSignVrRepository;
|
|
|
89
|
+use app\common\repositories\user\UserSignXfbRepository;
|
|
89
|
90
|
use app\common\repositories\user\UserThirdRepository;
|
|
90
|
91
|
use app\common\repositories\user\UserWithdrawalLimitRecordRepository;
|
|
91
|
92
|
use app\common\repositories\wechat\RoutineQrcodeRepository;
|
|
|
@@ -2387,7 +2388,7 @@ class StoreOrderRepository extends BaseRepository
|
|
2387
|
2388
|
}
|
|
2388
|
2389
|
}
|
|
2389
|
2390
|
|
|
2390
|
|
- $orderpri = $cartInfo['list'][$_k]['productAttr']['price'];
|
|
|
2391
|
+ $orderpri = bcmul($cartInfo['list'][$_k]['productAttr']['price'], $cartInfo['list'][$_k]['cart_num'], 2);
|
|
2391
|
2392
|
//var_dump($ss);
|
|
2392
|
2393
|
//支付组合
|
|
2393
|
2394
|
$num_yl = 0;
|
|
|
@@ -2395,23 +2396,23 @@ class StoreOrderRepository extends BaseRepository
|
|
2395
|
2396
|
$store_product_datas = Db::name('store_product')->where('product_id', $cart['product']['product_id'])->find();
|
|
2396
|
2397
|
//var_dump($store_product_datas); ["product_id"]=>string(5) "15748" concession_pri
|
|
2397
|
2398
|
|
|
2398
|
|
- if ($orderpri == '1180') {
|
|
|
2399
|
+ if ($orderpri / $cartInfo['list'][$_k]['cart_num'] == '1180') {
|
|
2399
|
2400
|
$num_yl = 1000;
|
|
2400
|
|
- } else if ($orderpri == '10620') {
|
|
|
2401
|
+ } else if ($orderpri / $cartInfo['list'][$_k]['cart_num'] == '10620') {
|
|
2401
|
2402
|
$num_yl = 9000;
|
|
2402
|
|
- } else if ($orderpri == '11800') {
|
|
|
2403
|
+ } else if ($orderpri / $cartInfo['list'][$_k]['cart_num'] == '11800') {
|
|
2403
|
2404
|
$num_yl = 10000;
|
|
2404
|
|
- } else if ($orderpri == '2360') {
|
|
|
2405
|
+ } else if ($orderpri / $cartInfo['list'][$_k]['cart_num'] == '2360') {
|
|
2405
|
2406
|
$num_yl = 2000;
|
|
2406
|
|
- } else if ($orderpri == '9440') {
|
|
|
2407
|
+ } else if ($orderpri / $cartInfo['list'][$_k]['cart_num'] == '9440') {
|
|
2407
|
2408
|
$num_yl = 8000;
|
|
2408
|
|
- } else if ($orderpri == '5900') {
|
|
|
2409
|
+ } else if ($orderpri / $cartInfo['list'][$_k]['cart_num'] == '5900') {
|
|
2409
|
2410
|
$num_yl = 5000;
|
|
2410
|
2411
|
}
|
|
2411
|
2412
|
|
|
2412
|
2413
|
if ($store_product_datas['mer_id'] == 496) {
|
|
2413
|
2414
|
|
|
2414
|
|
- $yanglao = bcmul($num_yl, 0.035, 2);//给预下订单中的商品展示 养老金 显示作用
|
|
|
2415
|
+ $yanglao = bcmul(bcmul($num_yl, 0.035, 2) , $cartInfo['list'][$_k]['cart_num'],2);//给预下订单中的商品展示 养老金 显示作用
|
|
2415
|
2416
|
$cartInfo['list'][$_k]['yanglao'] = $yanglao;
|
|
2416
|
2417
|
$pv = $num_yl;
|
|
2417
|
2418
|
//$v['vr']=$v['price'];
|
|
|
@@ -2468,7 +2469,8 @@ class StoreOrderRepository extends BaseRepository
|
|
2468
|
2469
|
$jf = $orderpri - bcmul($store_product_datas['concession_pri'], 0.3, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
2469
|
2470
|
$jd = $orderpri - bcmul($store_product_datas['concession_pri'], 0.35, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2470
|
2471
|
if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
|
|
2471
|
|
- $yanglao = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2472
|
+ $yanglao = bcmul(bcmul($store_product_datas['concession_pri'], 0.3, 2) , $cartInfo['list'][$_k]['cart_num'],2);
|
|
|
2473
|
+ $cartInfo['list'][$_k]['yanglao'] = $yanglao;
|
|
2472
|
2474
|
$pv = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2473
|
2475
|
$srtArry['jfduihuan'] = $jf;
|
|
2474
|
2476
|
$srtArry['jdduihuan'] = $jd;
|
|
|
@@ -2476,11 +2478,11 @@ class StoreOrderRepository extends BaseRepository
|
|
2476
|
2478
|
$gongxian = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2477
|
2479
|
|
|
2478
|
2480
|
$jcvr = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
|
|
2479
|
|
- $jcjf = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2481
|
+ $jcjf = bcmul(bcmul($store_product_datas['concession_pri'], 0.3, 2) , $cartInfo['list'][$_k]['cart_num'],2);
|
|
2480
|
2482
|
$jcprice = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
|
|
2481
|
|
- $jcjf1 = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2483
|
+ $jcjf1 = bcmul(bcmul($store_product_datas['concession_pri'], 0.3, 2) , $cartInfo['list'][$_k]['cart_num'],2);
|
|
2482
|
2484
|
$jcvr1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
|
|
2483
|
|
- $jcjd = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
|
2485
|
+ $jcjd = bcmul(bcmul($store_product_datas['concession_pri'], 0.35, 2), $cartInfo['list'][$_k]['cart_num'], 2);
|
|
2484
|
2486
|
$jcprice1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
|
|
2485
|
2487
|
$jcjd1 = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2486
|
2488
|
|
|
|
@@ -2525,7 +2527,7 @@ class StoreOrderRepository extends BaseRepository
|
|
2525
|
2527
|
$pv = $productSku['plate_mer_profit'] ?? 0.00;
|
|
2526
|
2528
|
//复购区
|
|
2527
|
2529
|
// $pv = bcmul($orderpri, 0.3, 2);
|
|
2528
|
|
- $yanglao = bcmul($pv, 0.5, 2);//给预下订单中的商品展示 养老金 显示作用
|
|
|
2530
|
+ $yanglao = bcmul(bcmul($pv, 0.5, 2) , $cartInfo['list'][$_k]['cart_num'],2);//给预下订单中的商品展示 养老金 显示作用
|
|
2529
|
2531
|
$cartInfo['list'][$_k]['pv'] = $pv;
|
|
2530
|
2532
|
$cartInfo['list'][$_k]['yanglao'] = $yanglao;
|
|
2531
|
2533
|
|
|
|
@@ -2543,7 +2545,7 @@ class StoreOrderRepository extends BaseRepository
|
|
2543
|
2545
|
$pvProportion = bcsub('1', bcdiv($sharedProsperityRecommendConfigEntityByMaxRewardRatio->getRewardRatio(), '100', 4), 2);
|
|
2544
|
2546
|
$pv = bcmul($productSku['plate_mer_profit'], $pvProportion, CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
2545
|
2547
|
|
|
2546
|
|
- $yanglao = bcmul($productSku['price'], CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['YangLaoJin']['Ratio']['code'], 2);
|
|
|
2548
|
+ $yanglao = bcmul(bcmul($productSku['price'], CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Self']['YangLaoJin']['Ratio']['code'], 2), $cartInfo['list'][$_k]['cart_num'], 2);
|
|
2547
|
2549
|
$cartInfo['list'][$_k]['pv'] = $pv;
|
|
2548
|
2550
|
$cartInfo['list'][$_k]['yanglao'] = $yanglao;
|
|
2549
|
2551
|
|
|
|
@@ -2561,7 +2563,8 @@ class StoreOrderRepository extends BaseRepository
|
|
2561
|
2563
|
$jf = $orderpri - bcmul($store_product_datas['concession_pri'], 0.3, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
2562
|
2564
|
$jd = $orderpri - bcmul($store_product_datas['concession_pri'], 0.35, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2563
|
2565
|
if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
|
|
2564
|
|
- $yanglao = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2566
|
+ $yanglao = bcmul(bcmul($store_product_datas['concession_pri'], 0.3, 2), $cartInfo['list'][$_k]['cart_num'], 2);
|
|
|
2567
|
+ $cartInfo['list'][$_k]['yanglao'] = $yanglao;
|
|
2565
|
2568
|
$pv = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2566
|
2569
|
$srtArry['jfduihuan'] = $jf;
|
|
2567
|
2570
|
$srtArry['jdduihuan'] = $jd;
|
|
|
@@ -2571,9 +2574,9 @@ class StoreOrderRepository extends BaseRepository
|
|
2571
|
2574
|
$jcvr = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
|
|
2572
|
2575
|
$jcjf = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
2573
|
2576
|
$jcprice = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
|
|
2574
|
|
- $jcjf1 = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2577
|
+ $jcjf1 = bcmul(bcmul($store_product_datas['concession_pri'], 0.3, 2), $cartInfo['list'][$_k]['cart_num'], 2);
|
|
2575
|
2578
|
$jcvr1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
|
|
2576
|
|
- $jcjd = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
|
2579
|
+ $jcjd = bcmul(bcmul($store_product_datas['concession_pri'], 0.35, 2), $cartInfo['list'][$_k]['cart_num'], 2);
|
|
2577
|
2580
|
$jcprice1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
|
|
2578
|
2581
|
$jcjd1 = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2579
|
2582
|
|
|
|
@@ -4016,14 +4019,14 @@ class StoreOrderRepository extends BaseRepository
|
|
4016
|
4019
|
$tuimark = "推荐消费获得养老金" . $tuiguanyanglaojin;
|
|
4017
|
4020
|
|
|
4018
|
4021
|
//end会费
|
|
4019
|
|
- //sat存养老金
|
|
4020
|
|
- $tuititle = "养老金 ";
|
|
4021
|
|
- $commission_type = 5;
|
|
4022
|
|
- if ($tuiguanyanglaojin >= 0.01) {
|
|
4023
|
|
- $this->add_bill($tuititle, $tuiguanyanglaojin, $sprerdUser["uid"], $tuimark, $commission_type, $order_sn, $order_id, $order["mer_id"], 0, 0, $order["type_shop"]);
|
|
4024
|
|
- } else {
|
|
4025
|
|
- Db::name('log')->insert(['data' => '订单号:' . $order_sn . '付款额度较低,推荐养老金低于0.01无法入库 特此记录!']);
|
|
4026
|
|
- }
|
|
|
4022
|
+ //sat存养老金 不发放推荐人养老金
|
|
|
4023
|
+ // $tuititle = "养老金 ";
|
|
|
4024
|
+ // $commission_type = 5;
|
|
|
4025
|
+ // if ($tuiguanyanglaojin >= 0.01) {
|
|
|
4026
|
+ // $this->add_bill($tuititle, $tuiguanyanglaojin, $sprerdUser["uid"], $tuimark, $commission_type, $order_sn, $order_id, $order["mer_id"], 0, 0, $order["type_shop"]);
|
|
|
4027
|
+ // } else {
|
|
|
4028
|
+ // Db::name('log')->insert(['data' => '订单号:' . $order_sn . '付款额度较低,推荐养老金低于0.01无法入库 特此记录!']);
|
|
|
4029
|
+ // }
|
|
4027
|
4030
|
|
|
4028
|
4031
|
}
|
|
4029
|
4032
|
|
|
|
@@ -9980,7 +9983,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9980
|
9983
|
// //推广佣金
|
|
9981
|
9984
|
$this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金', $store_order_data['mer_id'], 0);
|
|
9982
|
9985
|
//养老金
|
|
9983
|
|
- $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.05, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得养老金' . bcmul($pv, 0.05, 2), $store_order_data['mer_id'], 0);
|
|
|
9986
|
+ // $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.05, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得养老金' . bcmul($pv, 0.05, 2), $store_order_data['mer_id'], 0);
|
|
9984
|
9987
|
// 1123 用户分享的商品不得分享佣金 先暂时这样写
|
|
9985
|
9988
|
if($store_order_data['share_uid'] && $store_order_data['share_uid'] != 1123){
|
|
9986
|
9989
|
$this->bill_user_log($store_order_data['share_uid'], bcmul($pv * 0.9, 0.03, 2), $store_order_data['order_id'], 20, $store_order_data['order_sn'], '分享获得佣金', $store_order_data['mer_id'], 0);
|
|
|
@@ -10077,7 +10080,7 @@ class StoreOrderRepository extends BaseRepository
|
|
10077
|
10080
|
$this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 0, "推广会员专区商品赠送贡献值", 1);
|
|
10078
|
10081
|
|
|
10079
|
10082
|
//养老金
|
|
10080
|
|
- $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . round($pv * 0.035, 2), $store_order_data['mer_id']);
|
|
|
10083
|
+ // $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . round($pv * 0.035, 2), $store_order_data['mer_id']);
|
|
10081
|
10084
|
//佣金
|
|
10082
|
10085
|
$this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金', $store_order_data['mer_id']);
|
|
10083
|
10086
|
//复购金
|
|
|
@@ -10206,7 +10209,7 @@ class StoreOrderRepository extends BaseRepository
|
|
10206
|
10209
|
//推广佣金
|
|
10207
|
10210
|
$this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金', $store_order_data['mer_id'], 0);
|
|
10208
|
10211
|
//养老金
|
|
10209
|
|
- $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.05, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得养老金' . round($pv * 0.05, 2), $store_order_data['mer_id'], 0);
|
|
|
10212
|
+ // $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.05, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '推广获得养老金' . round($pv * 0.05, 2), $store_order_data['mer_id'], 0);
|
|
10210
|
10213
|
}
|
|
10211
|
10214
|
|
|
10212
|
10215
|
//普通用户推广人
|
|
|
@@ -11313,24 +11316,24 @@ class StoreOrderRepository extends BaseRepository
|
|
11313
|
11316
|
);
|
|
11314
|
11317
|
|
|
11315
|
11318
|
// 如果用户的身份 不是 普通用户 (高于普通用户) 则发放养老金
|
|
11316
|
|
- if ($userEntityBySpreadUid->getUserGroup() != CommonEnum::USER_GROUP['RegularUser']['code']) {
|
|
11317
|
|
- $yanglaojinBySpreadUid = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Spread']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
11318
|
|
- /** @var UserBillRepository $userBillRepository */
|
|
11319
|
|
- $userBillRepository = app()->make(UserBillRepository::class);
|
|
11320
|
|
- $userBillRepository->addUserBill(
|
|
11321
|
|
- $userEntityBySpreadUid->getUid(),
|
|
11322
|
|
- UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
|
|
11323
|
|
- UserBillEnum::PM['INCOME']['code'],
|
|
11324
|
|
- $yanglaojinBySpreadUid,
|
|
11325
|
|
- UserBillEnum::CATEGORY['NowMoney']['code'],
|
|
11326
|
|
- UserBillEnum::TYPE['Commission']['code'],
|
|
11327
|
|
- UserBillEnum::SOURCE['ONLINE']['code'],
|
|
11328
|
|
- UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'],
|
|
11329
|
|
- UserBillEnum::TYPE_SHOP['Platform']['code'],
|
|
11330
|
|
- $storeOrderEntity->getOrderId(),
|
|
11331
|
|
- '推广精彩生活区商品获得养老金'
|
|
11332
|
|
- );
|
|
11333
|
|
- }
|
|
|
11319
|
+ // if ($userEntityBySpreadUid->getUserGroup() != CommonEnum::USER_GROUP['RegularUser']['code']) {
|
|
|
11320
|
+ // $yanglaojinBySpreadUid = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['WonderfulLiving']['Spread']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
|
11321
|
+ // /** @var UserBillRepository $userBillRepository */
|
|
|
11322
|
+ // $userBillRepository = app()->make(UserBillRepository::class);
|
|
|
11323
|
+ // $userBillRepository->addUserBill(
|
|
|
11324
|
+ // $userEntityBySpreadUid->getUid(),
|
|
|
11325
|
+ // UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
|
|
|
11326
|
+ // UserBillEnum::PM['INCOME']['code'],
|
|
|
11327
|
+ // $yanglaojinBySpreadUid,
|
|
|
11328
|
+ // UserBillEnum::CATEGORY['NowMoney']['code'],
|
|
|
11329
|
+ // UserBillEnum::TYPE['Commission']['code'],
|
|
|
11330
|
+ // UserBillEnum::SOURCE['ONLINE']['code'],
|
|
|
11331
|
+ // UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'],
|
|
|
11332
|
+ // UserBillEnum::TYPE_SHOP['Platform']['code'],
|
|
|
11333
|
+ // $storeOrderEntity->getOrderId(),
|
|
|
11334
|
+ // '推广精彩生活区商品获得养老金'
|
|
|
11335
|
+ // );
|
|
|
11336
|
+ // }
|
|
11334
|
11337
|
}
|
|
11335
|
11338
|
}
|
|
11336
|
11339
|
|
|
|
@@ -11558,24 +11561,24 @@ class StoreOrderRepository extends BaseRepository
|
|
11558
|
11561
|
);
|
|
11559
|
11562
|
|
|
11560
|
11563
|
// 如果用户的身份 不是 普通用户 (高于普通用户) 则发放养老金
|
|
11561
|
|
- if ($userEntityBySpreadUid->getUserGroup() != CommonEnum::USER_GROUP['RegularUser']['code']) {
|
|
11562
|
|
- $yanglaojinBySpreadUid = bcmul($basePrice, CommonEnum::ORDER_EARNING_ALLOCATION['MemberZone']['Spread']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
11563
|
|
- /** @var UserBillRepository $userBillRepository */
|
|
11564
|
|
- $userBillRepository = app()->make(UserBillRepository::class);
|
|
11565
|
|
- $userBillRepository->addUserBill(
|
|
11566
|
|
- $userEntityBySpreadUid->getUid(),
|
|
11567
|
|
- UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
|
|
11568
|
|
- UserBillEnum::PM['INCOME']['code'],
|
|
11569
|
|
- $yanglaojinBySpreadUid,
|
|
11570
|
|
- UserBillEnum::CATEGORY['NowMoney']['code'],
|
|
11571
|
|
- UserBillEnum::TYPE['Commission']['code'],
|
|
11572
|
|
- UserBillEnum::SOURCE['ONLINE']['code'],
|
|
11573
|
|
- UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'],
|
|
11574
|
|
- UserBillEnum::TYPE_SHOP['Platform']['code'],
|
|
11575
|
|
- $storeOrderEntity->getOrderId(),
|
|
11576
|
|
- '推广会员专区商品获得养老金'
|
|
11577
|
|
- );
|
|
11578
|
|
- }
|
|
|
11564
|
+ // if ($userEntityBySpreadUid->getUserGroup() != CommonEnum::USER_GROUP['RegularUser']['code']) {
|
|
|
11565
|
+ // $yanglaojinBySpreadUid = bcmul($basePrice, CommonEnum::ORDER_EARNING_ALLOCATION['MemberZone']['Spread']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
|
11566
|
+ // /** @var UserBillRepository $userBillRepository */
|
|
|
11567
|
+ // $userBillRepository = app()->make(UserBillRepository::class);
|
|
|
11568
|
+ // $userBillRepository->addUserBill(
|
|
|
11569
|
+ // $userEntityBySpreadUid->getUid(),
|
|
|
11570
|
+ // UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
|
|
|
11571
|
+ // UserBillEnum::PM['INCOME']['code'],
|
|
|
11572
|
+ // $yanglaojinBySpreadUid,
|
|
|
11573
|
+ // UserBillEnum::CATEGORY['NowMoney']['code'],
|
|
|
11574
|
+ // UserBillEnum::TYPE['Commission']['code'],
|
|
|
11575
|
+ // UserBillEnum::SOURCE['ONLINE']['code'],
|
|
|
11576
|
+ // UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'],
|
|
|
11577
|
+ // UserBillEnum::TYPE_SHOP['Platform']['code'],
|
|
|
11578
|
+ // $storeOrderEntity->getOrderId(),
|
|
|
11579
|
+ // '推广会员专区商品获得养老金'
|
|
|
11580
|
+ // );
|
|
|
11581
|
+ // }
|
|
11579
|
11582
|
}
|
|
11580
|
11583
|
}
|
|
11581
|
11584
|
}
|
|
|
@@ -11733,27 +11736,50 @@ class StoreOrderRepository extends BaseRepository
|
|
11733
|
11736
|
'购买共富区商品获得PV'
|
|
11734
|
11737
|
);
|
|
11735
|
11738
|
|
|
|
11739
|
+ // 特定商品发放幸福币
|
|
|
11740
|
+ /** @var StoreCartRepository $storeCartRepository */
|
|
|
11741
|
+ $storeCartRepository = app()->make(StoreCartRepository::class);
|
|
|
11742
|
+ $storeCartEntity = $storeCartRepository->getCartEntityListByUidAndProductIdList($storeOrderEntity->getUid(), [90619]);
|
|
|
11743
|
+ if (!empty($storeCartEntityList)) {
|
|
|
11744
|
+ $xfbData = [
|
|
|
11745
|
+ 'uid' => $sharedProsperityUserEntity->getUserId(),
|
|
|
11746
|
+ 'before' => 0,
|
|
|
11747
|
+ 'number' => $storeOrderEntity->getPayPrice(),
|
|
|
11748
|
+ 'after' => 0,
|
|
|
11749
|
+ 'mark' => '购买共富区商品获得幸福币:' . $storeOrderEntity->getPayPrice(),
|
|
|
11750
|
+ 'desc' => '购买共富区商品获得幸福币',
|
|
|
11751
|
+ 'order_sn' => $storeOrderEntity->getOrderSn(),
|
|
|
11752
|
+ 'order_type' => $storeOrderEntity->getOrderType(),
|
|
|
11753
|
+ 'type' => 1,
|
|
|
11754
|
+ 'addtime' => time()
|
|
|
11755
|
+ ];
|
|
|
11756
|
+ }
|
|
|
11757
|
+ /** @var UserSignXfbRepository $xfbRepository */
|
|
|
11758
|
+ $xfbRepository = app()->make(UserSignXfbRepository::class);
|
|
|
11759
|
+ $xfbRepository->create($xfbData);
|
|
|
11760
|
+
|
|
|
11761
|
+
|
|
11736
|
11762
|
if (!empty($sharedProsperityUserEntity->getParentId())) {
|
|
11737
|
11763
|
// 如果 共富区推荐人 不是平台,则为 推荐人发放 推荐奖励
|
|
11738
|
11764
|
$sharedProsperityUserEntityByParent = $sharedProsperityUserRepository->getSharedProsperityUserEntityByUserId($sharedProsperityUserEntity->getParentId());
|
|
11739
|
11765
|
if (!empty($sharedProsperityUserEntityByParent->getId())) {
|
|
11740
|
11766
|
// 为 共富体系推荐人 发放养老金
|
|
11741
|
|
- $yanglaojinBySpreadUid = bcmul($storeOrderEntity->getTotalPrice(), CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Spread']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
11742
|
|
- /** @var UserBillRepository $userBillRepository */
|
|
11743
|
|
- $userBillRepository = app()->make(UserBillRepository::class);
|
|
11744
|
|
- $userBillRepository->addUserBill(
|
|
11745
|
|
- $sharedProsperityUserEntityByParent->getUserId(),
|
|
11746
|
|
- UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
|
|
11747
|
|
- UserBillEnum::PM['INCOME']['code'],
|
|
11748
|
|
- $yanglaojinBySpreadUid,
|
|
11749
|
|
- UserBillEnum::CATEGORY['NowMoney']['code'],
|
|
11750
|
|
- UserBillEnum::TYPE['Commission']['code'],
|
|
11751
|
|
- UserBillEnum::SOURCE['ONLINE']['code'],
|
|
11752
|
|
- UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'],
|
|
11753
|
|
- UserBillEnum::TYPE_SHOP['Platform']['code'],
|
|
11754
|
|
- $storeOrderEntity->getOrderId(),
|
|
11755
|
|
- '推广共富区会员消费获得养老金'
|
|
11756
|
|
- );
|
|
|
11767
|
+ // $yanglaojinBySpreadUid = bcmul($storeOrderEntity->getTotalPrice(), CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Spread']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
|
11768
|
+ // /** @var UserBillRepository $userBillRepository */
|
|
|
11769
|
+ // $userBillRepository = app()->make(UserBillRepository::class);
|
|
|
11770
|
+ // $userBillRepository->addUserBill(
|
|
|
11771
|
+ // $sharedProsperityUserEntityByParent->getUserId(),
|
|
|
11772
|
+ // UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
|
|
|
11773
|
+ // UserBillEnum::PM['INCOME']['code'],
|
|
|
11774
|
+ // $yanglaojinBySpreadUid,
|
|
|
11775
|
+ // UserBillEnum::CATEGORY['NowMoney']['code'],
|
|
|
11776
|
+ // UserBillEnum::TYPE['Commission']['code'],
|
|
|
11777
|
+ // UserBillEnum::SOURCE['ONLINE']['code'],
|
|
|
11778
|
+ // UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'],
|
|
|
11779
|
+ // UserBillEnum::TYPE_SHOP['Platform']['code'],
|
|
|
11780
|
+ // $storeOrderEntity->getOrderId(),
|
|
|
11781
|
+ // '推广共富区会员消费获得养老金'
|
|
|
11782
|
+ // );
|
|
11757
|
11783
|
|
|
11758
|
11784
|
// 发放消费股
|
|
11759
|
11785
|
$consumerStocksBySpread = bcmul($storeOrderEntity->getTotalPrice(), CommonEnum::ORDER_EARNING_ALLOCATION['SharedProsperity']['Spread']['ConsumerStocks']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
|
@@ -11975,24 +12001,24 @@ class StoreOrderRepository extends BaseRepository
|
|
11975
|
12001
|
);
|
|
11976
|
12002
|
|
|
11977
|
12003
|
// 如果用户的身份 不是 普通用户 (高于普通用户) 则发放养老金
|
|
11978
|
|
- if ($userEntityBySpreadUid->getUserGroup() != CommonEnum::USER_GROUP['RegularUser']['code']) {
|
|
11979
|
|
- $yanglaojinBySpreadUid = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['CommercialDistrict']['Spread']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
11980
|
|
- /** @var UserBillRepository $userBillRepository */
|
|
11981
|
|
- $userBillRepository = app()->make(UserBillRepository::class);
|
|
11982
|
|
- $userBillRepository->addUserBill(
|
|
11983
|
|
- $userEntityBySpreadUid->getUid(),
|
|
11984
|
|
- UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
|
|
11985
|
|
- UserBillEnum::PM['INCOME']['code'],
|
|
11986
|
|
- $yanglaojinBySpreadUid,
|
|
11987
|
|
- UserBillEnum::CATEGORY['NowMoney']['code'],
|
|
11988
|
|
- UserBillEnum::TYPE['Commission']['code'],
|
|
11989
|
|
- UserBillEnum::SOURCE['ONLINE']['code'],
|
|
11990
|
|
- UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'],
|
|
11991
|
|
- UserBillEnum::TYPE_SHOP['Platform']['code'],
|
|
11992
|
|
- $storeOrderEntity->getOrderId(),
|
|
11993
|
|
- '推广商贸区商品获得养老金'
|
|
11994
|
|
- );
|
|
11995
|
|
- }
|
|
|
12004
|
+ // if ($userEntityBySpreadUid->getUserGroup() != CommonEnum::USER_GROUP['RegularUser']['code']) {
|
|
|
12005
|
+ // $yanglaojinBySpreadUid = bcmul($storeOrderEntity->getConPri(), CommonEnum::ORDER_EARNING_ALLOCATION['CommercialDistrict']['Spread']['YangLaoJin']['Ratio']['code'], CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
|
12006
|
+ // /** @var UserBillRepository $userBillRepository */
|
|
|
12007
|
+ // $userBillRepository = app()->make(UserBillRepository::class);
|
|
|
12008
|
+ // $userBillRepository->addUserBill(
|
|
|
12009
|
+ // $userEntityBySpreadUid->getUid(),
|
|
|
12010
|
+ // UserBillEnum::COMMISSION_TYPE['PENSION']['code'],
|
|
|
12011
|
+ // UserBillEnum::PM['INCOME']['code'],
|
|
|
12012
|
+ // $yanglaojinBySpreadUid,
|
|
|
12013
|
+ // UserBillEnum::CATEGORY['NowMoney']['code'],
|
|
|
12014
|
+ // UserBillEnum::TYPE['Commission']['code'],
|
|
|
12015
|
+ // UserBillEnum::SOURCE['ONLINE']['code'],
|
|
|
12016
|
+ // UserBillEnum::ORDER_TYPE['SELF_OPERATED']['code'],
|
|
|
12017
|
+ // UserBillEnum::TYPE_SHOP['Platform']['code'],
|
|
|
12018
|
+ // $storeOrderEntity->getOrderId(),
|
|
|
12019
|
+ // '推广商贸区商品获得养老金'
|
|
|
12020
|
+ // );
|
|
|
12021
|
+ // }
|
|
11996
|
12022
|
}
|
|
11997
|
12023
|
}
|
|
11998
|
12024
|
|
|
|
@@ -12208,6 +12234,12 @@ class StoreOrderRepository extends BaseRepository
|
|
12208
|
12234
|
}, $userWithdrawalLimitRecordEntityList);
|
|
12209
|
12235
|
$userWithdrawalLimitRecordRepository->executeByIdList($userWithdrawalLimitRecordIdList);
|
|
12210
|
12236
|
}
|
|
|
12237
|
+
|
|
|
12238
|
+ // 结算幸福币
|
|
|
12239
|
+ /** @var UserSignXfbRepository $xfbRepository */
|
|
|
12240
|
+ $xfbRepository = app()->make(UserSignXfbRepository::class);
|
|
|
12241
|
+ // 结算
|
|
|
12242
|
+ $xfbRepository->settlement($unsettledOrderSnList);
|
|
12211
|
12243
|
} catch (DbException $e) {
|
|
12212
|
12244
|
throw new ValidateException('订单结算失败');
|
|
12213
|
12245
|
}
|