|
|
@@ -694,7 +694,7 @@ class StoreOrderRepository extends BaseRepository
|
|
694
|
694
|
// $mer_money += $moneys - $total_extension_one - $souxufees;
|
|
695
|
695
|
// if ($cartInfo['mer_id'] == 290) {
|
|
696
|
696
|
// $moneys = bcsub($moneys, $souxufees, 3);
|
|
697
|
|
-// $moneys = round($moneys, 2);
|
|
|
697
|
+// $moneys = round($moneys, 2);
|
|
698
|
698
|
// $total_extension_one = bcmul($moneys, '0.52', 3);
|
|
699
|
699
|
// $total_extension_one = round($total_extension_one, 2);
|
|
700
|
700
|
// $mer_money = bcmul($moneys, '0.40', 3);
|
|
|
@@ -1025,7 +1025,7 @@ class StoreOrderRepository extends BaseRepository
|
|
1025
|
1025
|
$le_yw_amount = 600;
|
|
1026
|
1026
|
}
|
|
1027
|
1027
|
|
|
1028
|
|
- $ylj_pri = round($pv * 0.035, 2);
|
|
|
1028
|
+ $ylj_pri = bcmul($pv, 0.035, 2);
|
|
1029
|
1029
|
//$pv = round($pv * 0.35,2);
|
|
1030
|
1030
|
|
|
1031
|
1031
|
//分配养老金给消费者
|
|
|
@@ -2233,7 +2233,7 @@ class StoreOrderRepository extends BaseRepository
|
|
2233
|
2233
|
|
|
2234
|
2234
|
if ($store_product_datas['mer_id'] == 496) {
|
|
2235
|
2235
|
|
|
2236
|
|
- $yanglao = round($num_yl * 0.035, 2);//给预下订单中的商品展示 养老金 显示作用
|
|
|
2236
|
+ $yanglao = bcmul($num_yl, 0.035, 2);//给预下订单中的商品展示 养老金 显示作用
|
|
2237
|
2237
|
$cartInfo['list'][$_k]['yanglao'] = $yanglao;
|
|
2238
|
2238
|
$pv = $num_yl;
|
|
2239
|
2239
|
//$v['vr']=$v['price'];
|
|
|
@@ -2241,7 +2241,7 @@ class StoreOrderRepository extends BaseRepository
|
|
2241
|
2241
|
|
|
2242
|
2242
|
|
|
2243
|
2243
|
//throw new ValidateException($user_datas['vr']);
|
|
2244
|
|
- if ($uid == 7 || $uid == 669 || $uid == 670 || $uid == 783 || $uid == 873 || $uid == 766 || $uid == 17 || $uid == 26) {
|
|
|
2244
|
+ // if ($uid == 7 || $uid == 669 || $uid == 670 || $uid == 783 || $uid == 873 || $uid == 766 || $uid == 17 || $uid == 26) {
|
|
2245
|
2245
|
//如果选择组合支付,查询当前用户名下的VR
|
|
2246
|
2246
|
$user_datas = Db::name('user')->where('uid', $uid)->find();
|
|
2247
|
2247
|
|
|
|
@@ -2273,38 +2273,38 @@ class StoreOrderRepository extends BaseRepository
|
|
2273
|
2273
|
}
|
|
2274
|
2274
|
|
|
2275
|
2275
|
|
|
2276
|
|
- } else {
|
|
2277
|
|
- $cartInfo['list'][$_k]['fzone_paytype'] = [
|
|
|
2276
|
+ // } else {
|
|
|
2277
|
+ // $cartInfo['list'][$_k]['fzone_paytype'] = [
|
|
2278
|
2278
|
|
|
2279
|
|
- ['type' => 'a1', 'price' => $orderpri, 'other' => 0, 'note' => "VR"],//VR支付
|
|
2280
|
|
- ['type' => 'a2', 'price' => $orderpri, 'other' => 0, 'note' => "现金"],//现金支付
|
|
2281
|
|
- // ['type'=>'a3','price'=>$orderpri,'other'=>0,'note'=>"现金+VR"],//现金支付
|
|
2282
|
|
- ];
|
|
2283
|
|
- }
|
|
|
2279
|
+ // ['type' => 'a1', 'price' => $orderpri, 'other' => 0, 'note' => "VR"],//VR支付
|
|
|
2280
|
+ // ['type' => 'a2', 'price' => $orderpri, 'other' => 0, 'note' => "现金"],//现金支付
|
|
|
2281
|
+ // // ['type'=>'a3','price'=>$orderpri,'other'=>0,'note'=>"现金+VR"],//现金支付
|
|
|
2282
|
+ // ];
|
|
|
2283
|
+ // }
|
|
2284
|
2284
|
|
|
2285
|
2285
|
|
|
2286
|
2286
|
} else if ($store_product_datas['mer_id'] == 439) {
|
|
2287
|
2287
|
|
|
2288
|
2288
|
|
|
2289
|
2289
|
//精彩生活和商贸区
|
|
2290
|
|
- $jf = $orderpri - round($store_product_datas['concession_pri'] * 0.3, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.3, 2);
|
|
2291
|
|
- $jd = $orderpri - round($store_product_datas['concession_pri'] * 0.35, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
|
2290
|
+ $jf = $orderpri - bcmul($store_product_datas['concession_pri'], 0.3, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2291
|
+ $jd = $orderpri - bcmul($store_product_datas['concession_pri'], 0.35, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2292
|
2292
|
if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
|
|
2293
|
|
- $yanglao = round($store_product_datas['concession_pri'] * 0.3, 2);
|
|
2294
|
|
- $pv = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
|
2293
|
+ $yanglao = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2294
|
+ $pv = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2295
|
2295
|
$srtArry['jfduihuan'] = $jf;
|
|
2296
|
2296
|
$srtArry['jdduihuan'] = $jd;
|
|
2297
|
|
- $jifen = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
2298
|
|
- $gongxian = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
2299
|
|
-
|
|
2300
|
|
- $jcvr = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
|
|
2301
|
|
- $jcjf = round($store_product_datas['concession_pri'] * 0.3, 2);
|
|
2302
|
|
- $jcprice = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
|
|
2303
|
|
- $jcjf1 = round($store_product_datas['concession_pri'] * 0.3, 2);
|
|
2304
|
|
- $jcvr1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
|
|
2305
|
|
- $jcjd = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
2306
|
|
- $jcprice1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
|
|
2307
|
|
- $jcjd1 = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
|
2297
|
+ $jifen = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
|
2298
|
+ $gongxian = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
|
2299
|
+
|
|
|
2300
|
+ $jcvr = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
|
|
|
2301
|
+ $jcjf = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2302
|
+ $jcprice = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
|
|
|
2303
|
+ $jcjf1 = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2304
|
+ $jcvr1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
|
|
|
2305
|
+ $jcjd = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
|
2306
|
+ $jcprice1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
|
|
|
2307
|
+ $jcjd1 = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2308
|
2308
|
|
|
2309
|
2309
|
//var_dump($cartInfo['list'][$_k]);
|
|
2310
|
2310
|
//支付组合
|
|
|
@@ -2346,8 +2346,8 @@ class StoreOrderRepository extends BaseRepository
|
|
2346
|
2346
|
// $productSku = Db::name('store_product_attr_value')->where('product_id', $good_id)->order('price asc')->find();
|
|
2347
|
2347
|
// $pv = $productSku['plate_mer_profit']??0.00;
|
|
2348
|
2348
|
//复购区
|
|
2349
|
|
- $pv = round($orderpri * 0.3, 2);
|
|
2350
|
|
- $yanglao = round($pv * 0.5, 2);//给预下订单中的商品展示 养老金 显示作用
|
|
|
2349
|
+ $pv = bcmul($orderpri, 0.3, 2);
|
|
|
2350
|
+ $yanglao = bcmul($pv, 0.5, 2);//给预下订单中的商品展示 养老金 显示作用
|
|
2351
|
2351
|
$cartInfo['list'][$_k]['pv'] = $pv;
|
|
2352
|
2352
|
$cartInfo['list'][$_k]['yanglao'] = $yanglao;
|
|
2353
|
2353
|
|
|
|
@@ -2362,24 +2362,24 @@ class StoreOrderRepository extends BaseRepository
|
|
2362
|
2362
|
$tmpMerchantInfo = $merchant->get($store_product_datas['mer_id']);
|
|
2363
|
2363
|
// 1企业2个体3个人
|
|
2364
|
2364
|
if ($tmpMerchantInfo && in_array($tmpMerchantInfo['type'], [2, 3])) {
|
|
2365
|
|
- $jf = $orderpri - round($store_product_datas['concession_pri'] * 0.3, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.3, 2);
|
|
2366
|
|
- $jd = $orderpri - round($store_product_datas['concession_pri'] * 0.35, 2) . ' + ' . round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
|
2365
|
+ $jf = $orderpri - bcmul($store_product_datas['concession_pri'], 0.3, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2366
|
+ $jd = $orderpri - bcmul($store_product_datas['concession_pri'], 0.35, 2) . ' + ' . bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2367
|
2367
|
if ($store_product_datas['concession_pri'] != null || $store_product_datas['concession_pri'] != 0) {
|
|
2368
|
|
- $yanglao = round($store_product_datas['concession_pri'] * 0.3, 2);
|
|
2369
|
|
- $pv = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
|
2368
|
+ $yanglao = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2369
|
+ $pv = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2370
|
2370
|
$srtArry['jfduihuan'] = $jf;
|
|
2371
|
2371
|
$srtArry['jdduihuan'] = $jd;
|
|
2372
|
|
- $jifen = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
2373
|
|
- $gongxian = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
2374
|
|
-
|
|
2375
|
|
- $jcvr = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
|
|
2376
|
|
- $jcjf = round($store_product_datas['concession_pri'] * 0.3, 2);
|
|
2377
|
|
- $jcprice = round($orderpri - round($store_product_datas['concession_pri'] * 0.3, 2), 2);
|
|
2378
|
|
- $jcjf1 = round($store_product_datas['concession_pri'] * 0.3, 2);
|
|
2379
|
|
- $jcvr1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
|
|
2380
|
|
- $jcjd = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
2381
|
|
- $jcprice1 = round($orderpri - round($store_product_datas['concession_pri'] * 0.35, 2), 2);
|
|
2382
|
|
- $jcjd1 = round($store_product_datas['concession_pri'] * 0.35, 2);
|
|
|
2372
|
+ $jifen = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
|
2373
|
+ $gongxian = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
|
2374
|
+
|
|
|
2375
|
+ $jcvr = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
|
|
|
2376
|
+ $jcjf = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2377
|
+ $jcprice = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.3, 2), 2);
|
|
|
2378
|
+ $jcjf1 = bcmul($store_product_datas['concession_pri'], 0.3, 2);
|
|
|
2379
|
+ $jcvr1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
|
|
|
2380
|
+ $jcjd = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
|
2381
|
+ $jcprice1 = bcsub($orderpri, bcmul($store_product_datas['concession_pri'], 0.35, 2), 2);
|
|
|
2382
|
+ $jcjd1 = bcmul($store_product_datas['concession_pri'], 0.35, 2);
|
|
2383
|
2383
|
|
|
2384
|
2384
|
//var_dump($cartInfo['list'][$_k]);
|
|
2385
|
2385
|
//支付组合
|
|
|
@@ -3725,7 +3725,7 @@ class StoreOrderRepository extends BaseRepository
|
|
3725
|
3725
|
|
|
3726
|
3726
|
$sanfangfenpei = json_decode($systemvalueObj['value'], true);
|
|
3727
|
3727
|
|
|
3728
|
|
- $oldagefee = round($order['total_price'] * $sanfangfenpei['yanglaojin'], 2);
|
|
|
3728
|
+ $oldagefee = bcmul($order['total_price'], $sanfangfenpei['yanglaojin'], 2);
|
|
3729
|
3729
|
log::info("++{$order['total_price']}+返回佣金===={$oldagefee}");
|
|
3730
|
3730
|
//当前已扣会费总额
|
|
3731
|
3731
|
// $oldagefee = $oldagefee-$dues;
|
|
|
@@ -3745,7 +3745,7 @@ class StoreOrderRepository extends BaseRepository
|
|
3745
|
3745
|
// 添加推荐奖励
|
|
3746
|
3746
|
log::info("推荐佣金kaishi");
|
|
3747
|
3747
|
//推荐养老金添加
|
|
3748
|
|
- $pvfee = round($order['total_price'] * $sanfangfenpei['pv'], 2);
|
|
|
3748
|
+ $pvfee = bcmul($order['total_price'], $sanfangfenpei['pv'], 2);
|
|
3749
|
3749
|
$zijiUser = Db::name("user")->where('uid', $order["uid"])->find();
|
|
3750
|
3750
|
$sprerdUser = Db::name("user")->where('uid', $zijiUser['spread_uid'])->find();
|
|
3751
|
3751
|
//不为空的时候进行添加推荐奖励
|
|
|
@@ -3756,7 +3756,7 @@ class StoreOrderRepository extends BaseRepository
|
|
3756
|
3756
|
if ($sprerdUser["user_group"] > 1) {
|
|
3757
|
3757
|
//奖励推荐者养老金
|
|
3758
|
3758
|
//养老金比例是pv佣金的5%
|
|
3759
|
|
- $tuiguanyanglaojin = round($pvfee * 0.05, 2);
|
|
|
3759
|
+ $tuiguanyanglaojin = bcmul($pvfee, 0.05, 2);
|
|
3760
|
3760
|
$tuimark = "推荐消费获得养老金" . $tuiguanyanglaojin;
|
|
3761
|
3761
|
|
|
3762
|
3762
|
//end会费
|
|
|
@@ -3804,7 +3804,7 @@ class StoreOrderRepository extends BaseRepository
|
|
3804
|
3804
|
$yongjinbili = 17;
|
|
3805
|
3805
|
}
|
|
3806
|
3806
|
|
|
3807
|
|
- $tuiguanyongjin = round($pvfee * $yongjinbili / 100, 2);
|
|
|
3807
|
+ $tuiguanyongjin = bcmul($pvfee, $yongjinbili / 100, 2);
|
|
3808
|
3808
|
|
|
3809
|
3809
|
|
|
3810
|
3810
|
$tuiYongmark = "推荐消费获得佣金" . $tuiguanyongjin;
|
|
|
@@ -3863,7 +3863,7 @@ class StoreOrderRepository extends BaseRepository
|
|
3863
|
3863
|
$sanfangfenpei = json_decode($systemvalueObj['value'], true);
|
|
3864
|
3864
|
|
|
3865
|
3865
|
// @todo 消费者本人获得复购PV
|
|
3866
|
|
- $consumerRepurchaseareaestimateannuity = round($order['total_price'] * $sanfangfenpei['yanglaojin'], 2);
|
|
|
3866
|
+ $consumerRepurchaseareaestimateannuity = bcmul($order['total_price'], $sanfangfenpei['yanglaojin'], 2);
|
|
3867
|
3867
|
log::info("++{$order['total_price']}+返回佣金===={$consumerRepurchaseareaestimateannuity}");
|
|
3868
|
3868
|
if ($consumerRepurchaseareaestimateannuity >= 0.01) {
|
|
3869
|
3869
|
$this->add_bill(
|
|
|
@@ -3879,7 +3879,7 @@ class StoreOrderRepository extends BaseRepository
|
|
3879
|
3879
|
$directThrustUserinfo = User::where('uid', $userinfo["spread_uid"])->find();
|
|
3880
|
3880
|
if (!empty($directThrustUserinfo)) {
|
|
3881
|
3881
|
// 直推养老金
|
|
3882
|
|
- $directThrustEstimateannuity = round($order['total_price'] * $sanfangfenpei['direct_thrust_ratio'], 2);
|
|
|
3882
|
+ $directThrustEstimateannuity = bcmul($order['total_price'], $sanfangfenpei['direct_thrust_ratio'], 2);
|
|
3883
|
3883
|
if ($directThrustEstimateannuity >= 0.01) {
|
|
3884
|
3884
|
$this->add_bill(
|
|
3885
|
3885
|
'养老金', $directThrustEstimateannuity, $directThrustUserinfo["uid"], "复购-直接推广者获得养老金" . $directThrustEstimateannuity,
|
|
|
@@ -3895,7 +3895,7 @@ class StoreOrderRepository extends BaseRepository
|
|
3895
|
3895
|
$indirectThrustUserinfo = User::where('uid', $directThrustUserinfo["spread_uid"])->find();
|
|
3896
|
3896
|
if (!empty($indirectThrustUserinfo)) {
|
|
3897
|
3897
|
// 间推养老金
|
|
3898
|
|
- $indirectThrustEstimateannuity = round($order['total_price'] * $sanfangfenpei['indirect_thrust_ratio'], 2);
|
|
|
3898
|
+ $indirectThrustEstimateannuity = bcmul($order['total_price'], $sanfangfenpei['indirect_thrust_ratio'], 2);
|
|
3899
|
3899
|
if ($indirectThrustEstimateannuity >= 0.01) {
|
|
3900
|
3900
|
$this->add_bill(
|
|
3901
|
3901
|
'养老金', $indirectThrustEstimateannuity, $indirectThrustUserinfo["uid"], "复购-间接推广者获得养老金" . $indirectThrustEstimateannuity,
|
|
|
@@ -6698,25 +6698,29 @@ class StoreOrderRepository extends BaseRepository
|
|
6698
|
6698
|
}
|
|
6699
|
6699
|
$details = GongApiRequest::order_details($value['douhuomall_order_no']);
|
|
6700
|
6700
|
if (!$details) continue;
|
|
6701
|
|
- $data['supply_type'] = $details['supply_type'];
|
|
|
6701
|
+
|
|
|
6702
|
+ $track = GongApiRequest::order_track($value['douhuomall_order_no']);
|
|
|
6703
|
+
|
|
|
6704
|
+ $data['supply_type'] = $details['supply_type'] ?? 0;
|
|
6702
|
6705
|
$data['delivery_type'] = 1;
|
|
6703
|
|
- $data['delivery_name'] = $details['logistics_company'] ?? '';
|
|
6704
|
|
- $data['delivery_id'] = $details['logistics_number'][0] ?? '';
|
|
|
6706
|
+ $data['delivery_name'] = $track['logistics'][0]['logistics_name'] ?? '';
|
|
|
6707
|
+ $data['delivery_id'] = $track['logistics'][0]['logistics_code'] ?? '';
|
|
6705
|
6708
|
$data['douhuomall_status'] = $details['status'];
|
|
6706
|
6709
|
if ($data['douhuomall_status'] == 3 && $value['status'] < 2) {
|
|
6707
|
6710
|
// Db::name('log')->insert(['data'=>'微唯宝订单信息确认收货'.$value['order_id'].json_encode($order)]);
|
|
6708
|
6711
|
$data['status'] = 1;
|
|
|
6712
|
+
|
|
6709
|
6713
|
} elseif ($data['douhuomall_status'] == 4 && ($value['status'] != 3 || $value['status'] != 4 || $value['status'] != 5)) {
|
|
6710
|
6714
|
//微唯宝订单状态已完成,并且平台状态不是已完成,申请退款,已退款
|
|
6711
|
6715
|
$data['status'] = 2;
|
|
6712
|
6716
|
} else {
|
|
6713
|
6717
|
$data['status'] = $value['status'];
|
|
6714
|
|
- }
|
|
|
6718
|
+ }
|
|
6715
|
6719
|
Db::name('store_order')->where('order_sn', $value['order_sn'])->update($data);
|
|
6716
|
6720
|
$s = [
|
|
6717
|
6721
|
'order_id' => $value['order_id'],
|
|
6718
|
6722
|
'douhuomall_order_no' => $value['douhuomall_order_no'],
|
|
6719
|
|
- 'supply_type' => $details['supply_type'],
|
|
|
6723
|
+ 'supply_type' => $details['supply_type'] ?? 0,
|
|
6720
|
6724
|
'douhuomall_status' => $details['status']
|
|
6721
|
6725
|
];
|
|
6722
|
6726
|
$this->douhuomall_order_s($value['douhuomall_order_no'], $s);
|
|
|
@@ -6754,9 +6758,10 @@ class StoreOrderRepository extends BaseRepository
|
|
6754
|
6758
|
// }
|
|
6755
|
6759
|
// $this -> dou_dc();
|
|
6756
|
6760
|
Db::name('log')->insert(['data' => '微唯宝订单信息查询执行成功' . $i]);
|
|
6757
|
|
-
|
|
|
6761
|
+ echo '微唯宝订单信息查询执行成功';
|
|
6758
|
6762
|
} catch (Exception $e) {
|
|
6759
|
6763
|
Db::name('log')->insert(['data' => '供应链订单信息:' . $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】']);
|
|
|
6764
|
+ echo $e->getFile() . ':' . $e->getLine() . '【' . $e->getMessage() . '】';
|
|
6760
|
6765
|
}
|
|
6761
|
6766
|
}
|
|
6762
|
6767
|
|
|
|
@@ -9225,7 +9230,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9225
|
9230
|
|
|
9226
|
9231
|
|
|
9227
|
9232
|
//添加贡献值日志
|
|
9228
|
|
- public function con_log($uid, $num, $order_id, $order_type, $mark, $status = -1)
|
|
|
9233
|
+ public function con_log($uid, $num, $order_id, $order_type, $mark, $status = -1, $pv = 0)
|
|
9229
|
9234
|
{
|
|
9230
|
9235
|
|
|
9231
|
9236
|
$con_data = Db::name('user')->where("uid", $uid)->find();
|
|
|
@@ -9233,7 +9238,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9233
|
9238
|
if ($status == 1) {
|
|
9234
|
9239
|
//$con_data_gongxian = Db::name('user')->where("uid", $uid)->update(['contribute' => $con_data['contribute'] + $num]);
|
|
9235
|
9240
|
//如果当前用户是业务经理之前的等级,那么需要将当前用户的直推用户贡献值加到自己贡献值中去
|
|
9236
|
|
- if ($con_data['user_group'] <= 2) {
|
|
|
9241
|
+ // if ($con_data['user_group'] <= 2) {
|
|
9237
|
9242
|
|
|
9238
|
9243
|
$spread_data = Db::name('user')->where("spread_uid", $uid)->select();
|
|
9239
|
9244
|
|
|
|
@@ -9283,24 +9288,25 @@ class StoreOrderRepository extends BaseRepository
|
|
9283
|
9288
|
|
|
9284
|
9289
|
// }
|
|
9285
|
9290
|
|
|
9286
|
|
- } else {
|
|
|
9291
|
+ // } else {
|
|
9287
|
9292
|
|
|
9288
|
|
- // 检查是否包含“推广”
|
|
9289
|
|
- // if (strpos($mark, "推广") !== false) {
|
|
9290
|
|
- // echo "字符串1包含'推广'\n";
|
|
9291
|
|
- // }
|
|
|
9293
|
+ // // 检查是否包含“推广”
|
|
|
9294
|
+ // // if (strpos($mark, "推广") !== false) {
|
|
|
9295
|
+ // // echo "字符串1包含'推广'\n";
|
|
|
9296
|
+ // // }
|
|
9292
|
9297
|
|
|
9293
|
|
- // 检查是否包含“购买”
|
|
9294
|
|
- if (strpos($mark, "购买") !== false) {
|
|
9295
|
|
- Db::name('user')->where("uid", $uid)->update(['contribute' => $con_data['contribute'] + $num]);
|
|
9296
|
|
- }
|
|
|
9298
|
+ // // 检查是否包含“购买”
|
|
|
9299
|
+ // if (strpos($mark, "购买") !== false) {
|
|
|
9300
|
+ // Db::name('user')->where("uid", $uid)->update(['contribute' => $con_data['contribute'] + $num]);
|
|
|
9301
|
+ // }
|
|
9297
|
9302
|
|
|
9298
|
9303
|
|
|
9299
|
|
- }
|
|
|
9304
|
+ // }
|
|
9300
|
9305
|
}
|
|
9301
|
9306
|
|
|
9302
|
9307
|
$con = [
|
|
9303
|
9308
|
'uid' => $uid,
|
|
|
9309
|
+ 'pv' => $pv,
|
|
9304
|
9310
|
'number' => $num,//赠送数量
|
|
9305
|
9311
|
'status' => $status,//红包状态
|
|
9306
|
9312
|
'mark' => $mark,//备注
|
|
|
@@ -9535,8 +9541,8 @@ class StoreOrderRepository extends BaseRepository
|
|
9535
|
9541
|
$job_par = json_decode($store_order_data['fzone_paytype'], true);
|
|
9536
|
9542
|
//if($job_par['note'] == "现金"){
|
|
9537
|
9543
|
//普通消费者
|
|
9538
|
|
- $ylj_pri = round($concession_pri * 0.3, 2);
|
|
9539
|
|
- $pv = round($concession_pri * 0.35, 2);
|
|
|
9544
|
+ $ylj_pri = bcmul($concession_pri, 0.3, 2);
|
|
|
9545
|
+ $pv = bcmul($concession_pri, 0.35, 2);
|
|
9540
|
9546
|
|
|
9541
|
9547
|
//分配养老金给消费者
|
|
9542
|
9548
|
$ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
|
|
|
@@ -9565,18 +9571,18 @@ class StoreOrderRepository extends BaseRepository
|
|
9565
|
9571
|
|
|
9566
|
9572
|
// //给推广者分配佣金
|
|
9567
|
9573
|
$yj_amount = 0;
|
|
9568
|
|
- $ylj_amount = $spread_data['annuity'] + round($pv * 0.05, 2);
|
|
|
9574
|
+ $ylj_amount = $spread_data['annuity'] + bcmul($pv, 0.05, 2);
|
|
9569
|
9575
|
$ssf = 0;//变量
|
|
9570
|
9576
|
$yj_amount_90 = 0;//90%的佣金
|
|
9571
|
9577
|
|
|
9572
|
9578
|
if ($spread_data['user_group'] == 2) {
|
|
9573
|
|
- $ssf = round($pv * $rate, 2);
|
|
9574
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
9575
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
9579
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
9580
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
9581
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9576
|
9582
|
|
|
9577
|
9583
|
|
|
9578
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
9579
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9584
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9585
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9580
|
9586
|
|
|
9581
|
9587
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9582
|
9588
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9585,12 +9591,12 @@ class StoreOrderRepository extends BaseRepository
|
|
9585
|
9591
|
|
|
9586
|
9592
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9587
|
9593
|
} else if ($spread_data['user_group'] == 3) {
|
|
9588
|
|
- $ssf = round($pv * $rate, 2);
|
|
9589
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
9590
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
9594
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
9595
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
9596
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9591
|
9597
|
|
|
9592
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
9593
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9598
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9599
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9594
|
9600
|
|
|
9595
|
9601
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9596
|
9602
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9598,12 +9604,12 @@ class StoreOrderRepository extends BaseRepository
|
|
9598
|
9604
|
|
|
9599
|
9605
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9600
|
9606
|
} else if ($spread_data['user_group'] == 4) {
|
|
9601
|
|
- $ssf = round($pv * $rate, 2);
|
|
9602
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
9603
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
9607
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
9608
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
9609
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9604
|
9610
|
|
|
9605
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
9606
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9611
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9612
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9607
|
9613
|
|
|
9608
|
9614
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9609
|
9615
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9611,13 +9617,13 @@ class StoreOrderRepository extends BaseRepository
|
|
9611
|
9617
|
|
|
9612
|
9618
|
//Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9613
|
9619
|
} else if ($spread_data['user_group'] == 5) {
|
|
9614
|
|
- $ssf = round($pv * $rate, 2);
|
|
9615
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
9616
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
9620
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
9621
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
9622
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9617
|
9623
|
// $yj_amount = $spread_data['brokerage_price'] + round($pv * $rate,2);
|
|
9618
|
9624
|
|
|
9619
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
9620
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9625
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9626
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9621
|
9627
|
|
|
9622
|
9628
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9623
|
9629
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9625,12 +9631,12 @@ class StoreOrderRepository extends BaseRepository
|
|
9625
|
9631
|
|
|
9626
|
9632
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9627
|
9633
|
} else if ($spread_data['user_group'] == 6) {
|
|
9628
|
|
- $ssf = round($pv * $rate, 2);
|
|
9629
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
9630
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
9634
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
9635
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
9636
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9631
|
9637
|
|
|
9632
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
9633
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9638
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9639
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9634
|
9640
|
|
|
9635
|
9641
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9636
|
9642
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9638,13 +9644,13 @@ class StoreOrderRepository extends BaseRepository
|
|
9638
|
9644
|
|
|
9639
|
9645
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
9640
|
9646
|
} else if ($spread_data['user_group'] == 7) {
|
|
9641
|
|
- $ssf = round($pv * $rate, 2);
|
|
9642
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
9643
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
9647
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
9648
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
9649
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9644
|
9650
|
|
|
9645
|
9651
|
|
|
9646
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
9647
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9652
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9653
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9648
|
9654
|
|
|
9649
|
9655
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9650
|
9656
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9658,17 +9664,17 @@ class StoreOrderRepository extends BaseRepository
|
|
9658
|
9664
|
//积分
|
|
9659
|
9665
|
$this->score_log($spread_data['uid'], $ssf, $store_order_data['order_id'], 11, "精彩生活区商品赠送积分");
|
|
9660
|
9666
|
// //推广佣金
|
|
9661
|
|
- $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
|
9667
|
+ $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
9662
|
9668
|
//养老金
|
|
9663
|
|
- $this->bill_user_log($spread_data['uid'], round($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);
|
|
|
9669
|
+ $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);
|
|
9664
|
9670
|
}
|
|
9665
|
9671
|
|
|
9666
|
9672
|
//普通用户推广人
|
|
9667
|
9673
|
if ($spread_data['user_group'] == 1) {
|
|
9668
|
9674
|
//给推广者分配佣金
|
|
9669
|
9675
|
|
|
9670
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
9671
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9676
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
9677
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9672
|
9678
|
|
|
9673
|
9679
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9674
|
9680
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9676,19 +9682,19 @@ class StoreOrderRepository extends BaseRepository
|
|
9676
|
9682
|
|
|
9677
|
9683
|
//Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
|
|
9678
|
9684
|
|
|
9679
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
9680
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
9685
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
9686
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
9681
|
9687
|
|
|
9682
|
9688
|
//贡献值和积分
|
|
9683
|
9689
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
|
|
9684
|
9690
|
|
|
9685
|
9691
|
//推广养老金
|
|
9686
|
9692
|
//推广佣金
|
|
9687
|
|
- $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
|
9693
|
+ $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
9688
|
9694
|
// 贡献值
|
|
9689
|
|
- $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值");
|
|
|
9695
|
+ $this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, $pv);
|
|
9690
|
9696
|
//积分
|
|
9691
|
|
- $this->score_log($spread_data['uid'], round($pv * $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分");
|
|
|
9697
|
+ $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分");
|
|
9692
|
9698
|
}
|
|
9693
|
9699
|
}
|
|
9694
|
9700
|
|
|
|
@@ -9703,8 +9709,8 @@ class StoreOrderRepository extends BaseRepository
|
|
9703
|
9709
|
|
|
9704
|
9710
|
//给推广者分配佣金
|
|
9705
|
9711
|
|
|
9706
|
|
- $yj_amount_90 = round($pv * 0.05, 2) * 0.9;
|
|
9707
|
|
- $fgj_amount_10 = round($pv * 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
9712
|
+ $yj_amount_90 = bcmul($pv, 0.05, 2) * 0.9;
|
|
|
9713
|
+ $fgj_amount_10 = bcmul($pv, 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
9708
|
9714
|
|
|
9709
|
9715
|
// $yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
|
|
9710
|
9716
|
// $fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9713,7 +9719,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9713
|
9719
|
|
|
9714
|
9720
|
// Db::name('user')->where('uid',$merchant_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
|
|
9715
|
9721
|
//推广佣金
|
|
9716
|
|
- $this->bill_user_log($merchant_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
|
9722
|
+ $this->bill_user_log($merchant_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
9717
|
9723
|
|
|
9718
|
9724
|
}
|
|
9719
|
9725
|
|
|
|
@@ -9755,7 +9761,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9755
|
9761
|
$le_yw_amount = 600;
|
|
9756
|
9762
|
}
|
|
9757
|
9763
|
|
|
9758
|
|
- $ylj_pri = round($pv * 0.035, 2);
|
|
|
9764
|
+ $ylj_pri = bcmul($pv, 0.035, 2);
|
|
9759
|
9765
|
//$pv = round($pv * 0.35,2);
|
|
9760
|
9766
|
|
|
9761
|
9767
|
//分配养老金给消费者
|
|
|
@@ -9767,8 +9773,8 @@ class StoreOrderRepository extends BaseRepository
|
|
9767
|
9773
|
|
|
9768
|
9774
|
// Db::name('user')->where('uid',$user_data['uid'])->update(['annuity'=>$ylj_amount_mine,'contribute'=> $gxz_amount_mine,'score'=> $jf_amount_mine]);
|
|
9769
|
9775
|
|
|
9770
|
|
- $this->bill_user_log($user_data['uid'], round($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']);
|
|
9771
|
|
- $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1);
|
|
|
9776
|
+ $this->bill_user_log($user_data['uid'], bcmul($pv, 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . bcmul($pv, 0.035, 2), $store_order_data['mer_id']);
|
|
|
9777
|
+ $this->con_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送贡献值", 1, $pv);
|
|
9772
|
9778
|
$this->score_log($user_data['uid'], $gx_jf, $store_order_data['order_id'], 11, "购买会员专区商品赠送积分", 1);
|
|
9773
|
9779
|
|
|
9774
|
9780
|
//查询下单用户上级身份(2.0新表用户)
|
|
|
@@ -9799,7 +9805,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9799
|
9805
|
$con = 0;//贡献值
|
|
9800
|
9806
|
$score = 0;//积分
|
|
9801
|
9807
|
//养老金
|
|
9802
|
|
- $uer_bill = $spread_data['annuity'] + round($pv * 0.035, 2);
|
|
|
9808
|
+ $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035, 2);
|
|
9803
|
9809
|
//$yongjin = $spread_data['brokerage_price'] + $le_yw_amount;
|
|
9804
|
9810
|
|
|
9805
|
9811
|
$yj_amount_90 = $le_yw_amount * 0.9;
|
|
|
@@ -9811,80 +9817,80 @@ class StoreOrderRepository extends BaseRepository
|
|
9811
|
9817
|
|
|
9812
|
9818
|
if ($spread_data['user_group'] == 2) {
|
|
9813
|
9819
|
|
|
9814
|
|
- $con = $spread_data['contribute'] + round($pv * 0.07, 2);
|
|
9815
|
|
- $score = $spread_data['brokerage_price'] + round($pv * 0.07, 2);
|
|
|
9820
|
+ $con = $spread_data['contribute'] + bcmul($pv, 0.07, 2);
|
|
|
9821
|
+ $score = $spread_data['brokerage_price'] + bcmul($pv, 0.07, 2);
|
|
9816
|
9822
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9817
|
9823
|
|
|
9818
|
9824
|
//贡献值
|
|
9819
|
9825
|
// $this->con_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9820
|
9826
|
//积分
|
|
9821
|
|
- $this->score_log($spread_data['uid'], round($pv * 0.07, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9827
|
+ $this->score_log($spread_data['uid'], bcmul($pv, 0.07, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9822
|
9828
|
|
|
9823
|
9829
|
} else if ($spread_data['user_group'] == 3) {
|
|
9824
|
9830
|
|
|
9825
|
9831
|
|
|
9826
|
|
- $con = $spread_data['contribute'] + round($pv * 0.09, 2);
|
|
9827
|
|
- $score = $spread_data['brokerage_price'] + round($pv * 0.09, 2);
|
|
|
9832
|
+ $con = $spread_data['contribute'] + bcmul($pv, 0.09, 2);
|
|
|
9833
|
+ $score = $spread_data['brokerage_price'] + bcmul($pv, 0.09, 2);
|
|
9828
|
9834
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9829
|
9835
|
|
|
9830
|
9836
|
//贡献值
|
|
9831
|
9837
|
// $this->con_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9832
|
9838
|
//积分
|
|
9833
|
|
- $this->score_log($spread_data['uid'], round($pv * 0.09, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9839
|
+ $this->score_log($spread_data['uid'], bcmul($pv, 0.09, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9834
|
9840
|
|
|
9835
|
9841
|
|
|
9836
|
9842
|
} else if ($spread_data['user_group'] == 4) {
|
|
9837
|
|
- $con = $spread_data['contribute'] + round($pv * 0.11, 2);
|
|
9838
|
|
- $score = $spread_data['brokerage_price'] + round($pv * 0.11, 2);
|
|
|
9843
|
+ $con = $spread_data['contribute'] + bcmul($pv, 0.11, 2);
|
|
|
9844
|
+ $score = $spread_data['brokerage_price'] + bcmul($pv, 0.11, 2);
|
|
9839
|
9845
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9840
|
9846
|
|
|
9841
|
9847
|
//贡献值
|
|
9842
|
9848
|
//$this->con_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9843
|
9849
|
//积分
|
|
9844
|
|
- $this->score_log($spread_data['uid'], round($pv * 0.11, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9850
|
+ $this->score_log($spread_data['uid'], bcmul($pv, 0.11, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9845
|
9851
|
|
|
9846
|
9852
|
|
|
9847
|
9853
|
} else if ($spread_data['user_group'] == 5) {
|
|
9848
|
|
- $con = $spread_data['contribute'] + round($pv * 0.13, 2);
|
|
9849
|
|
- $score = $spread_data['brokerage_price'] + round($pv * 0.13, 2);
|
|
|
9854
|
+ $con = $spread_data['contribute'] + bcmul($pv, 0.13, 2);
|
|
|
9855
|
+ $score = $spread_data['brokerage_price'] + bcmul($pv, 0.13, 2);
|
|
9850
|
9856
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9851
|
9857
|
|
|
9852
|
9858
|
//贡献值
|
|
9853
|
9859
|
// $this->con_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9854
|
9860
|
//积分
|
|
9855
|
|
- $this->score_log($spread_data['uid'], round($pv * 0.13, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9861
|
+ $this->score_log($spread_data['uid'], bcmul($pv, 0.13, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9856
|
9862
|
|
|
9857
|
9863
|
} else if ($spread_data['user_group'] == 6) {
|
|
9858
|
|
- $con = $spread_data['contribute'] + round($pv * 0.15, 2);
|
|
9859
|
|
- $score = $spread_data['brokerage_price'] + round($pv * 0.15, 2);
|
|
|
9864
|
+ $con = $spread_data['contribute'] + bcmul($pv, 0.15, 2);
|
|
|
9865
|
+ $score = $spread_data['brokerage_price'] + bcmul($pv, 0.15, 2);
|
|
9860
|
9866
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9861
|
9867
|
|
|
9862
|
9868
|
//贡献值
|
|
9863
|
9869
|
// $this->con_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9864
|
9870
|
//积分
|
|
9865
|
|
- $this->score_log($spread_data['uid'], round($pv * 0.15, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9871
|
+ $this->score_log($spread_data['uid'], bcmul($pv, 0.15, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9866
|
9872
|
|
|
9867
|
9873
|
|
|
9868
|
9874
|
} else if ($spread_data['user_group'] == 7) {
|
|
9869
|
|
- $con = $spread_data['contribute'] + round($pv * 0.17, 2);
|
|
9870
|
|
- $score = $spread_data['brokerage_price'] + round($pv * 0.17, 2);
|
|
|
9875
|
+ $con = $spread_data['contribute'] + bcmul($pv, 0.17, 2);
|
|
|
9876
|
+ $score = $spread_data['brokerage_price'] + bcmul($pv, 0.17, 2);
|
|
9871
|
9877
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9872
|
9878
|
|
|
9873
|
9879
|
//贡献值
|
|
9874
|
9880
|
//$this->con_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9875
|
9881
|
//积分
|
|
9876
|
|
- $this->score_log($spread_data['uid'], round($pv * 0.17, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9882
|
+ $this->score_log($spread_data['uid'], bcmul($pv, 0.17, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9877
|
9883
|
|
|
9878
|
9884
|
|
|
9879
|
9885
|
}
|
|
9880
|
9886
|
Db::name('test_log')->insert(['note' => "走到这里4"]);//测试
|
|
9881
|
9887
|
//贡献值
|
|
9882
|
|
- $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
|
|
|
9888
|
+ $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, $pv);
|
|
9883
|
9889
|
|
|
9884
|
9890
|
//养老金
|
|
9885
|
|
- $this->bill_user_log($spread_data['uid'], round($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']);
|
|
|
9891
|
+ $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']);
|
|
9886
|
9892
|
//佣金
|
|
9887
|
|
- $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
|
|
|
9893
|
+ $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id']);
|
|
9888
|
9894
|
//复购金
|
|
9889
|
9895
|
$this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
9890
|
9896
|
|
|
|
@@ -9894,11 +9900,11 @@ class StoreOrderRepository extends BaseRepository
|
|
9894
|
9900
|
if ($spread_data['user_group'] == 1) {
|
|
9895
|
9901
|
|
|
9896
|
9902
|
//获取贡献值和积分和佣金
|
|
9897
|
|
- $gx_jf = $spread_data['contribute'] + round($pv * 0.21, 2);
|
|
|
9903
|
+ $gx_jf = $spread_data['contribute'] + bcmul($pv, 0.21, 2);
|
|
9898
|
9904
|
|
|
9899
|
9905
|
|
|
9900
|
|
- $yj_amount_90 = round($yj1 * 0.9, 2);
|
|
9901
|
|
- $fgj_amount_10 = round($yj1 * 0.1, 2);//推广者的佣金抽10%到个人复购金
|
|
|
9906
|
+ $yj_amount_90 = bcmul($yj1, 0.9, 2);
|
|
|
9907
|
+ $fgj_amount_10 = bcmul($yj1, 0.1, 2);//推广者的佣金抽10%到个人复购金
|
|
9902
|
9908
|
|
|
9903
|
9909
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9904
|
9910
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -9906,10 +9912,10 @@ class StoreOrderRepository extends BaseRepository
|
|
9906
|
9912
|
|
|
9907
|
9913
|
|
|
9908
|
9914
|
//Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $gx_jf,'score'=> $gx_jf,'brokerage_price'=> $yj_amount,'fugou'=>$fgj_amount]);
|
|
9909
|
|
- $this->con_log($spread_data['uid'], round($pv * 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
|
|
9910
|
|
- $this->score_log($spread_data['uid'], round($pv * 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
|
9915
|
+ $this->con_log($spread_data['uid'], bcmul($pv, 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, $pv);
|
|
|
9916
|
+ $this->score_log($spread_data['uid'], bcmul($pv, 0.21, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送积分", 1);
|
|
9911
|
9917
|
//推广佣金
|
|
9912
|
|
- $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
|
|
|
9918
|
+ $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id']);
|
|
9913
|
9919
|
}
|
|
9914
|
9920
|
|
|
9915
|
9921
|
|
|
|
@@ -9919,7 +9925,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9919
|
9925
|
$spread_data = Db::name('user')->where('uid', $spread_data_old['id'])->find();
|
|
9920
|
9926
|
//$spread_data = Db::name('user')->where('uid',473)->find();
|
|
9921
|
9927
|
//养老金
|
|
9922
|
|
- $uer_bill = $spread_data['annuity'] + round($pv * 0.035, 2);
|
|
|
9928
|
+ $uer_bill = $spread_data['annuity'] + bcmul($pv, 0.035, 2);
|
|
9923
|
9929
|
|
|
9924
|
9930
|
|
|
9925
|
9931
|
$yj_amount_90 = $le_yw_amount * 0.9;
|
|
|
@@ -9928,11 +9934,11 @@ class StoreOrderRepository extends BaseRepository
|
|
9928
|
9934
|
$yongjin = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9929
|
9935
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9930
|
9936
|
|
|
9931
|
|
- $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1);
|
|
|
9937
|
+ $this->con_log($spread_data['uid'], round($gx_jf, 2), $store_order_data['order_id'], 11, "推广会员专区商品赠送贡献值", 1, $pv);
|
|
9932
|
9938
|
//养老金
|
|
9933
|
|
- $this->bill_user_log($spread_data['uid'], round($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']);
|
|
|
9939
|
+ $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.035, 2), $store_order_data['order_id'], 5, $store_order_data['order_sn'], '消费获得养老金' . bcmul($pv, 0.035, 2), $store_order_data['mer_id']);
|
|
9934
|
9940
|
//佣金
|
|
9935
|
|
- $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id']);
|
|
|
9941
|
+ $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id']);
|
|
9936
|
9942
|
//复购金
|
|
9937
|
9943
|
$this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1, 1);
|
|
9938
|
9944
|
|
|
|
@@ -10004,8 +10010,8 @@ class StoreOrderRepository extends BaseRepository
|
|
10004
|
10010
|
if (!empty($merchant_data) && !empty($merchant_user_data)) {
|
|
10005
|
10011
|
|
|
10006
|
10012
|
|
|
10007
|
|
- $yj_amount_90 = round($pv * 0.035, 2) * 0.9;
|
|
10008
|
|
- $fgj_amount_10 = round($pv * 0.035, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10013
|
+ $yj_amount_90 = bcmul($pv , 0.035, 2) * 0.9;
|
|
|
10014
|
+ $fgj_amount_10 = bcmul($pv, 0.035, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10009
|
10015
|
|
|
10010
|
10016
|
$yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
|
|
10011
|
10017
|
$fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -10014,7 +10020,7 @@ class StoreOrderRepository extends BaseRepository
|
|
10014
|
10020
|
|
|
10015
|
10021
|
// Db::name('user')->where('uid',$merchant_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
|
|
10016
|
10022
|
//推广佣金
|
|
10017
|
|
- $this->bill_user_log($merchant_data['uid'], round($pv * 0.35, 2), $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得拥金' . round($pv * 0.35, 2), $store_order_data['mer_id']);
|
|
|
10023
|
+ $this->bill_user_log($merchant_data['uid'], bcmul($pv, 0.35, 2), $store_order_data['order_id'], 3, $store_order_data['order_sn'], '推广获得佣金' . round($pv * 0.35, 2), $store_order_data['mer_id']);
|
|
10018
|
10024
|
}
|
|
10019
|
10025
|
|
|
10020
|
10026
|
}
|
|
|
@@ -10054,8 +10060,8 @@ class StoreOrderRepository extends BaseRepository
|
|
10054
|
10060
|
// 1企业2个体3个人
|
|
10055
|
10061
|
if ($merchantInfo && !empty($store_order_data) && in_array($merchantInfo['type'], [2, 3])) {
|
|
10056
|
10062
|
//商家让利部分的拆分
|
|
10057
|
|
- $ylj_pri = round($concession_pri * 0.3, 2); // 让利部分30%给消费者做养老金
|
|
10058
|
|
- $pv = round($concession_pri * 0.35, 2); // 35%做业绩PV分配
|
|
|
10063
|
+ $ylj_pri = bcmul($concession_pri, 0.3, 2); // 让利部分30%给消费者做养老金
|
|
|
10064
|
+ $pv = bcmul($concession_pri, 0.35, 2); // 35%做业绩PV分配
|
|
10059
|
10065
|
|
|
10060
|
10066
|
//分配养老金给消费者
|
|
10061
|
10067
|
$ylj_amount_mine = $user_data['annuity'] + $ylj_pri;
|
|
|
@@ -10082,24 +10088,24 @@ class StoreOrderRepository extends BaseRepository
|
|
10082
|
10088
|
$yj_amount_90 = 0;//90%的佣金
|
|
10083
|
10089
|
// 业务员
|
|
10084
|
10090
|
if ($spread_data['user_group'] == 2) {
|
|
10085
|
|
- $ssf = round($pv * $rate, 2);
|
|
10086
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
10087
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
10091
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
10092
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
10093
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10088
|
10094
|
|
|
10089
|
10095
|
|
|
10090
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
10091
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10096
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
10097
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10092
|
10098
|
|
|
10093
|
10099
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10094
|
10100
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
10095
|
10101
|
$this->fugou_user_log($spread_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10096
|
10102
|
} else if ($spread_data['user_group'] == 3) {
|
|
10097
|
|
- $ssf = round($pv * $rate, 2);
|
|
10098
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
10099
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
10103
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
10104
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
10105
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10100
|
10106
|
|
|
10101
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
10102
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10107
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
10108
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10103
|
10109
|
|
|
10104
|
10110
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10105
|
10111
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -10107,12 +10113,12 @@ class StoreOrderRepository extends BaseRepository
|
|
10107
|
10113
|
|
|
10108
|
10114
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10109
|
10115
|
} else if ($spread_data['user_group'] == 4) {
|
|
10110
|
|
- $ssf = round($pv * $rate, 2);
|
|
10111
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
10112
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
10116
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
10117
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
10118
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10113
|
10119
|
|
|
10114
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
10115
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10120
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
10121
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10116
|
10122
|
|
|
10117
|
10123
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10118
|
10124
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -10120,13 +10126,13 @@ class StoreOrderRepository extends BaseRepository
|
|
10120
|
10126
|
|
|
10121
|
10127
|
//Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10122
|
10128
|
} else if ($spread_data['user_group'] == 5) {
|
|
10123
|
|
- $ssf = round($pv * $rate, 2);
|
|
10124
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
10125
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
10129
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
10130
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
10131
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10126
|
10132
|
// $yj_amount = $spread_data['brokerage_price'] + round($pv * $rate,2);
|
|
10127
|
10133
|
|
|
10128
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
10129
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10134
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
10135
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10130
|
10136
|
|
|
10131
|
10137
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10132
|
10138
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -10134,12 +10140,12 @@ class StoreOrderRepository extends BaseRepository
|
|
10134
|
10140
|
|
|
10135
|
10141
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10136
|
10142
|
} else if ($spread_data['user_group'] == 6) {
|
|
10137
|
|
- $ssf = round($pv * $rate, 2);
|
|
10138
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
10139
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
10143
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
10144
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
10145
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10140
|
10146
|
|
|
10141
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
10142
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10147
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
10148
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10143
|
10149
|
|
|
10144
|
10150
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10145
|
10151
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -10147,13 +10153,13 @@ class StoreOrderRepository extends BaseRepository
|
|
10147
|
10153
|
|
|
10148
|
10154
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yj_amount,'annuity'=>$ylj_amount,'fugou'=>$fgj_amount]);
|
|
10149
|
10155
|
} else if ($spread_data['user_group'] == 7) {
|
|
10150
|
|
- $ssf = round($pv * $rate, 2);
|
|
10151
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
10152
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
10156
|
+ $ssf = bcmul($pv, $rate, 2);
|
|
|
10157
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
10158
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10153
|
10159
|
|
|
10154
|
10160
|
|
|
10155
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
10156
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10161
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
10162
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10157
|
10163
|
|
|
10158
|
10164
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10159
|
10165
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -10167,17 +10173,17 @@ class StoreOrderRepository extends BaseRepository
|
|
10167
|
10173
|
//积分
|
|
10168
|
10174
|
$this->score_log($spread_data['uid'], $ssf, $store_order_data['order_id'], 12, "商贸区商品赠送积分");
|
|
10169
|
10175
|
//推广佣金
|
|
10170
|
|
- $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $group_order['group_order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
|
10176
|
+ $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $group_order['group_order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
10171
|
10177
|
//养老金
|
|
10172
|
|
- $this->bill_user_log($spread_data['uid'], round($pv * 0.05, 2), $store_order_data['order_id'], 5, $group_order['group_order_sn'], '推广获得养老金' . round($pv * 0.05, 2), $store_order_data['mer_id'], 0);
|
|
|
10178
|
+ $this->bill_user_log($spread_data['uid'], bcmul($pv, 0.05, 2), $store_order_data['order_id'], 5, $group_order['group_order_sn'], '推广获得养老金' . round($pv * 0.05, 2), $store_order_data['mer_id'], 0);
|
|
10173
|
10179
|
}
|
|
10174
|
10180
|
|
|
10175
|
10181
|
//普通用户推广人
|
|
10176
|
10182
|
if ($spread_data['user_group'] == 1) {
|
|
10177
|
10183
|
//给推广者分配佣金
|
|
10178
|
10184
|
|
|
10179
|
|
- $yj_amount_90 = round($pv * $rate, 2) * 0.9;
|
|
10180
|
|
- $fgj_amount_10 = round($pv * $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10185
|
+ $yj_amount_90 = bcmul($pv, $rate, 2) * 0.9;
|
|
|
10186
|
+ $fgj_amount_10 = bcmul($pv, $rate, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10181
|
10187
|
|
|
10182
|
10188
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
10183
|
10189
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
|
@@ -10185,18 +10191,18 @@ class StoreOrderRepository extends BaseRepository
|
|
10185
|
10191
|
|
|
10186
|
10192
|
//Db::name('user')->where('uid',$spread_data['uid'])->update(['brokerage_price'=>$yj_amount,'fugou'=>$fgj_amount]);
|
|
10187
|
10193
|
|
|
10188
|
|
- $con = $spread_data['contribute'] + round($pv * $rate, 2);
|
|
10189
|
|
- $score = $spread_data['score'] + round($pv * $rate, 2);
|
|
|
10194
|
+ $con = $spread_data['contribute'] + bcmul($pv, $rate, 2);
|
|
|
10195
|
+ $score = $spread_data['score'] + bcmul($pv, $rate, 2);
|
|
10190
|
10196
|
|
|
10191
|
10197
|
//贡献值和积分
|
|
10192
|
10198
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(["contribute"=>$con,"score"=>$score]);
|
|
10193
|
10199
|
|
|
10194
|
10200
|
//推广佣金
|
|
10195
|
|
- $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $group_order['group_order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
|
10201
|
+ $this->bill_user_log($spread_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $group_order['group_order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
10196
|
10202
|
// 贡献值
|
|
10197
|
10203
|
$this->con_log($spread_data['uid'], $pv, $store_order_data['order_id'], 12, "推广商贸区商品赠送贡献值");
|
|
10198
|
10204
|
// 积分
|
|
10199
|
|
- $this->score_log($spread_data['uid'], round($pv * $rate, 2), $store_order_data['order_id'], 12, "推广商贸区商品赠送积分");
|
|
|
10205
|
+ $this->score_log($spread_data['uid'], bcmul($pv, $rate, 2), $store_order_data['order_id'], 12, "推广商贸区商品赠送积分");
|
|
10200
|
10206
|
}
|
|
10201
|
10207
|
}
|
|
10202
|
10208
|
|
|
|
@@ -10206,15 +10212,15 @@ class StoreOrderRepository extends BaseRepository
|
|
10206
|
10212
|
$merchant_user_data = Db::name('user')->where('uid', $merchant_data['uid'])->find();
|
|
10207
|
10213
|
if (!empty($merchant_user_data)) {
|
|
10208
|
10214
|
//给推广者分配佣金
|
|
10209
|
|
- $yj_amount_90 = round($pv * 0.05, 2) * 0.9;
|
|
10210
|
|
- $fgj_amount_10 = round($pv * 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
|
10215
|
+ $yj_amount_90 = bcmul($pv, 0.05, 2) * 0.9;
|
|
|
10216
|
+ $fgj_amount_10 = bcmul($pv, 0.05, 2) * 0.1;//推广者的佣金抽10%到个人复购金
|
|
10211
|
10217
|
|
|
10212
|
10218
|
$yj_amount = $merchant_user_data['brokerage_price'] + $yj_amount_90;
|
|
10213
|
10219
|
$fgj_amount = $merchant_user_data['fugou'] + $fgj_amount_10;
|
|
10214
|
10220
|
$this->fugou_user_log($merchant_data['uid'], $fgj_amount_10, $store_order_data['order_id'], 1);
|
|
10215
|
10221
|
|
|
10216
|
10222
|
//推广佣金
|
|
10217
|
|
- $this->bill_user_log($merchant_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $group_order['group_order_sn'], '推广获得拥金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
|
10223
|
+ $this->bill_user_log($merchant_data['uid'], $yj_amount_90, $store_order_data['order_id'], 3, $group_order['group_order_sn'], '推广获得佣金' . $yj_amount_90, $store_order_data['mer_id'], 0);
|
|
10218
|
10224
|
}
|
|
10219
|
10225
|
/** @var OrderMerchantRepository $orderMerchantRepository */
|
|
10220
|
10226
|
$orderMerchantRepository = app()->make(OrderMerchantRepository::class);
|
|
|
@@ -10222,7 +10228,7 @@ class StoreOrderRepository extends BaseRepository
|
|
10222
|
10228
|
|
|
10223
|
10229
|
//商户获得贡献值
|
|
10224
|
10230
|
if ($concession_pri >= 0.01) {
|
|
10225
|
|
- $gonxian = round($concession_pri * $jdAndGonxianConfig['gonxian'], 2);
|
|
|
10231
|
+ $gonxian = bcmul($concession_pri, $jdAndGonxianConfig['gonxian'], 2);
|
|
10226
|
10232
|
$gongxian_data = [
|
|
10227
|
10233
|
"uid" => $merchant_data["uid"],
|
|
10228
|
10234
|
"mer_id" => $user_data['mer_id'],
|
|
|
@@ -10244,7 +10250,7 @@ class StoreOrderRepository extends BaseRepository
|
|
10244
|
10250
|
|
|
10245
|
10251
|
//商户获得京豆
|
|
10246
|
10252
|
if ($concession_pri >= 0.01) {
|
|
10247
|
|
- $jd = round($concession_pri * $jdAndGonxianConfig['jd'], 2);
|
|
|
10253
|
+ $jd = bcmul($concession_pri, $jdAndGonxianConfig['jd'], 2);
|
|
10248
|
10254
|
$jd_data = [
|
|
10249
|
10255
|
"uid" => $merchant_data["uid"],
|
|
10250
|
10256
|
"mer_id" => $user_data['mer_id'],
|
|
|
@@ -10307,7 +10313,7 @@ class StoreOrderRepository extends BaseRepository
|
|
10307
|
10313
|
|
|
10308
|
10314
|
|
|
10309
|
10315
|
//code...
|
|
10310
|
|
- $pay_gb = round($orderInfo['num'] * $orderInfo['gb_num'], 2);
|
|
|
10316
|
+ $pay_gb = bcmul($orderInfo['num'], $orderInfo['gb_num'], 2);
|
|
10311
|
10317
|
//$pay_vr = round($orderInfo['num'] * $orderInfo['vr_num'],2);
|
|
10312
|
10318
|
//付款按照700的VR付款 start
|
|
10313
|
10319
|
$vr_num = 0;
|
|
|
@@ -10340,17 +10346,17 @@ class StoreOrderRepository extends BaseRepository
|
|
10340
|
10346
|
|
|
10341
|
10347
|
if ($goods_of_info['money'] == 1180) {
|
|
10342
|
10348
|
//修改订单到账状态
|
|
10343
|
|
- $zs_ylj = round(700 * 0.05, 2);//计算的养老金 金额
|
|
|
10349
|
+ $zs_ylj = bcmul(700, 0.05, 2);//计算的养老金 金额
|
|
10344
|
10350
|
} elseif ($goods_of_info['money'] == 11800) {
|
|
10345
|
|
- $zs_ylj = round(7000 * 0.05, 2);//计算的养老金 金额
|
|
|
10351
|
+ $zs_ylj = bcmul(7000, 0.05, 2);//计算的养老金 金额
|
|
10346
|
10352
|
} elseif ($goods_of_info['money'] == 3540) {
|
|
10347
|
|
- $zs_ylj = round(2100 * 0.05, 2);//计算的养老金 金额
|
|
|
10353
|
+ $zs_ylj = bcmul(2100, 0.05, 2);//计算的养老金 金额
|
|
10348
|
10354
|
} elseif ($goods_of_info['money'] == 10620) {
|
|
10349
|
|
- $zs_ylj = round(6300 * 0.05, 2);//计算的养老金 金额
|
|
|
10355
|
+ $zs_ylj = bcmul(6300, 0.05, 2);//计算的养老金 金额
|
|
10350
|
10356
|
} elseif ($goods_of_info['money'] == 9440) {
|
|
10351
|
|
- $zs_ylj = round(5600 * 0.05, 2);//八单计算的养老金 金额
|
|
|
10357
|
+ $zs_ylj = bcmul(5600, 0.05, 2);//八单计算的养老金 金额
|
|
10352
|
10358
|
} elseif ($goods_of_info['money'] == 2360) {
|
|
10353
|
|
- $zs_ylj = round(1400 * 0.05, 2);//两单计算的养老金 金额
|
|
|
10359
|
+ $zs_ylj = bcmul(1400, 0.05, 2);//两单计算的养老金 金额
|
|
10354
|
10360
|
}
|
|
10355
|
10361
|
|
|
10356
|
10362
|
|