|
|
@@ -8878,14 +8878,18 @@ class StoreOrderRepository extends BaseRepository
|
|
8878
|
8878
|
|
|
8879
|
8879
|
|
|
8880
|
8880
|
//添加贡献值日志
|
|
8881
|
|
- public function con_log($uid,$num,$order_id,$order_type,$mark){
|
|
|
8881
|
+ public function con_log($uid,$num,$order_id,$order_type,$mark,$status = -1){
|
|
8882
|
8882
|
|
|
8883
|
8883
|
$con_data = Db::name('user')->where("uid",$uid)->find();
|
|
|
8884
|
+ //如果状态是1那就是即刻入账,
|
|
|
8885
|
+ if($status == 1){
|
|
|
8886
|
+ $con_data_gongxian = Db::name('user')->where("uid",$uid)->update(['contribute'=>$con_data['contribute'] + $num]);
|
|
|
8887
|
+ }
|
|
8884
|
8888
|
|
|
8885
|
8889
|
$con = [
|
|
8886
|
8890
|
'uid'=>$uid,
|
|
8887
|
8891
|
'number'=>$num,//赠送数量
|
|
8888
|
|
- 'status'=>-1,//红包状态
|
|
|
8892
|
+ 'status'=>$status,//红包状态
|
|
8889
|
8893
|
'mark'=>$mark,//备注
|
|
8890
|
8894
|
'desc'=>'',//描述
|
|
8891
|
8895
|
'order_id'=>$order_id,//订单id
|
|
|
@@ -8899,10 +8903,14 @@ class StoreOrderRepository extends BaseRepository
|
|
8899
|
8903
|
Db::name('user_sign_gongxian')->insert($con);
|
|
8900
|
8904
|
}
|
|
8901
|
8905
|
|
|
8902
|
|
-//添加积分日志
|
|
8903
|
|
- public function score_log($uid,$num,$order_id,$order_type,$mark){
|
|
|
8906
|
+ //添加积分日志
|
|
|
8907
|
+ public function score_log($uid,$num,$order_id,$order_type,$mark,$status = -1){
|
|
8904
|
8908
|
|
|
8905
|
8909
|
$score_data = Db::name('user')->where("uid",$uid)->find();
|
|
|
8910
|
+ //如果状态是1那就是即刻入账,
|
|
|
8911
|
+ if($status == 1){
|
|
|
8912
|
+ $con_data_score = Db::name('user')->where("uid",$uid)->update(['score'=>$score_data['score'] + $num]);
|
|
|
8913
|
+ }
|
|
8906
|
8914
|
|
|
8907
|
8915
|
$score = [
|
|
8908
|
8916
|
'uid'=>$uid,
|
|
|
@@ -8910,7 +8918,7 @@ class StoreOrderRepository extends BaseRepository
|
|
8910
|
8918
|
'reward_socre'=>$num,//积分数量
|
|
8911
|
8919
|
'signin_time'=>0,//签到时间
|
|
8912
|
8920
|
'source_uid'=>0,//赠送积分用户来源id
|
|
8913
|
|
- 'status'=>-1,//积分状态1:有效,0:失效,1:待确认
|
|
|
8921
|
+ 'status'=>$status,//积分状态1:有效,0:失效,1:待确认
|
|
8914
|
8922
|
'mark'=> $mark,//备注
|
|
8915
|
8923
|
'order_id'=>$order_id,//订单id
|
|
8916
|
8924
|
'pm'=>1,//1收入,2支出
|
|
|
@@ -8929,6 +8937,14 @@ class StoreOrderRepository extends BaseRepository
|
|
8929
|
8937
|
public function bill_user_log($uid,$num,$order_id,$comm_order_type,$order_sn,$mark,$merid,$ds=1){
|
|
8930
|
8938
|
|
|
8931
|
8939
|
$con_data = Db::name('user')->where("uid",$uid)->find();
|
|
|
8940
|
+ //如果是会员专区就即刻到账
|
|
|
8941
|
+ $order_from_mer = Db::name('store_order')->where("order_id",$order_id)->find();
|
|
|
8942
|
+ if($order_from_mer['mer_id'] == 496 && $comm_order_type==3){
|
|
|
8943
|
+ // Db::name('user')->where("order_id",$order_id)->find();
|
|
|
8944
|
+ Db::name('user')->where("uid",$con_data['uid'])->update(['brokerage_price'=> $con_data['brokerage_price'] + $num]);
|
|
|
8945
|
+ }
|
|
|
8946
|
+
|
|
|
8947
|
+
|
|
8932
|
8948
|
$name = '';
|
|
8933
|
8949
|
if($comm_order_type==3){
|
|
8934
|
8950
|
$name = '直推奖';
|
|
|
@@ -8971,12 +8987,18 @@ class StoreOrderRepository extends BaseRepository
|
|
8971
|
8987
|
}
|
|
8972
|
8988
|
|
|
8973
|
8989
|
//添加复购金
|
|
8974
|
|
- public function fugou_user_log($uid,$num,$order_id,$type_inc_des){
|
|
|
8990
|
+ public function fugou_user_log($uid,$num,$order_id,$type_inc_des,$status=-1){
|
|
|
8991
|
+
|
|
|
8992
|
+ $fugou_data = Db::name('user')->where("uid",$uid)->find();
|
|
|
8993
|
+ //如果状态是1那就是即刻入账,
|
|
|
8994
|
+ if($status == 1){
|
|
|
8995
|
+ $con_data_fugoujin = Db::name('user')->where("uid",$uid)->update(['fugou'=>$fugou_data['fugou'] + $num]);
|
|
|
8996
|
+ }
|
|
8975
|
8997
|
|
|
8976
|
8998
|
$bill = [
|
|
8977
|
8999
|
'uid'=>$uid,
|
|
8978
|
9000
|
'number'=>$num,//数量
|
|
8979
|
|
- 'status'=>1,//复购金状态1-有效 0-失效 -1待确认
|
|
|
9001
|
+ 'status'=>$status,//复购金状态1-有效 0-失效 -1待确认
|
|
8980
|
9002
|
'mark'=>"复购金",//备注
|
|
8981
|
9003
|
'desc'=>"抽取佣金的10%作为复购金",//描述
|
|
8982
|
9004
|
'order_id'=>$order_id,//订单id
|
|
|
@@ -9272,8 +9294,8 @@ class StoreOrderRepository extends BaseRepository
|
|
9272
|
9294
|
|
|
9273
|
9295
|
$this->bill_user_log($user_data['uid'],round($pv * 0.035,2),$store_order_data['order_id'],5,$group_order['group_order_sn'],'消费获得养老金'.round($pv * 0.035,2),$store_order_data['mer_id']);
|
|
9274
|
9296
|
|
|
9275
|
|
- $this->con_log($user_data['uid'],$gx_jf,$store_order_data['order_id'],11,"购买会员专区商品赠送贡献值");
|
|
9276
|
|
- $this->score_log($user_data['uid'],$gx_jf,$store_order_data['order_id'],11,"购买会员专区商品赠送积分");
|
|
|
9297
|
+ $this->con_log($user_data['uid'],$gx_jf,$store_order_data['order_id'],11,"购买会员专区商品赠送贡献值",1);
|
|
|
9298
|
+ $this->score_log($user_data['uid'],$gx_jf,$store_order_data['order_id'],11,"购买会员专区商品赠送积分",1);
|
|
9277
|
9299
|
|
|
9278
|
9300
|
//给推广者分配养老金
|
|
9279
|
9301
|
//给推广者分配佣金
|
|
|
@@ -9310,9 +9332,9 @@ class StoreOrderRepository extends BaseRepository
|
|
9310
|
9332
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9311
|
9333
|
|
|
9312
|
9334
|
//贡献值
|
|
9313
|
|
- $this->con_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值");
|
|
|
9335
|
+ $this->con_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9314
|
9336
|
//积分
|
|
9315
|
|
- $this->score_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分");
|
|
|
9337
|
+ $this->score_log($spread_data['uid'],round($pv * 0.07,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
|
|
9316
|
9338
|
|
|
9317
|
9339
|
}else if($spread_data['user_group'] == 3){
|
|
9318
|
9340
|
$con = $spread_data['contribute'] + round($pv * 0.09,2);
|
|
|
@@ -9320,9 +9342,9 @@ class StoreOrderRepository extends BaseRepository
|
|
9320
|
9342
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9321
|
9343
|
|
|
9322
|
9344
|
//贡献值
|
|
9323
|
|
- $this->con_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值");
|
|
|
9345
|
+ $this->con_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9324
|
9346
|
//积分
|
|
9325
|
|
- $this->score_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分");
|
|
|
9347
|
+ $this->score_log($spread_data['uid'],round($pv * 0.09,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
|
|
9326
|
9348
|
|
|
9327
|
9349
|
|
|
9328
|
9350
|
}else if($spread_data['user_group'] == 4){
|
|
|
@@ -9331,9 +9353,9 @@ class StoreOrderRepository extends BaseRepository
|
|
9331
|
9353
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9332
|
9354
|
|
|
9333
|
9355
|
//贡献值
|
|
9334
|
|
- $this->con_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值");
|
|
|
9356
|
+ $this->con_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9335
|
9357
|
//积分
|
|
9336
|
|
- $this->score_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分");
|
|
|
9358
|
+ $this->score_log($spread_data['uid'],round($pv * 0.11,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
|
|
9337
|
9359
|
|
|
9338
|
9360
|
|
|
9339
|
9361
|
}else if($spread_data['user_group'] == 5){
|
|
|
@@ -9342,9 +9364,9 @@ class StoreOrderRepository extends BaseRepository
|
|
9342
|
9364
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9343
|
9365
|
|
|
9344
|
9366
|
//贡献值
|
|
9345
|
|
- $this->con_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值");
|
|
|
9367
|
+ $this->con_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9346
|
9368
|
//积分
|
|
9347
|
|
- $this->score_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分");
|
|
|
9369
|
+ $this->score_log($spread_data['uid'],round($pv * 0.13,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
|
|
9348
|
9370
|
|
|
9349
|
9371
|
}else if($spread_data['user_group'] == 6){
|
|
9350
|
9372
|
$con = $spread_data['contribute'] + round($pv * 0.15,2);
|
|
|
@@ -9352,9 +9374,9 @@ class StoreOrderRepository extends BaseRepository
|
|
9352
|
9374
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9353
|
9375
|
|
|
9354
|
9376
|
//贡献值
|
|
9355
|
|
- $this->con_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值");
|
|
|
9377
|
+ $this->con_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9356
|
9378
|
//积分
|
|
9357
|
|
- $this->score_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分");
|
|
|
9379
|
+ $this->score_log($spread_data['uid'],round($pv * 0.15,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
|
|
9358
|
9380
|
|
|
9359
|
9381
|
|
|
9360
|
9382
|
}else if($spread_data['user_group'] == 7){
|
|
|
@@ -9363,9 +9385,9 @@ class StoreOrderRepository extends BaseRepository
|
|
9363
|
9385
|
// Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $con,'score'=> $score,'brokerage_price'=> $yongjin,'annuity'=>$uer_bill,"fugou"=> $fgj_amount]);
|
|
9364
|
9386
|
|
|
9365
|
9387
|
//贡献值
|
|
9366
|
|
- $this->con_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值");
|
|
|
9388
|
+ $this->con_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
9367
|
9389
|
//积分
|
|
9368
|
|
- $this->score_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分");
|
|
|
9390
|
+ $this->score_log($spread_data['uid'],round($pv * 0.17,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
|
|
9369
|
9391
|
|
|
9370
|
9392
|
|
|
9371
|
9393
|
}
|
|
|
@@ -9374,7 +9396,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9374
|
9396
|
//佣金
|
|
9375
|
9397
|
$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']);
|
|
9376
|
9398
|
//复购金
|
|
9377
|
|
- $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
|
|
|
9399
|
+ $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1,1);
|
|
9378
|
9400
|
|
|
9379
|
9401
|
}
|
|
9380
|
9402
|
|
|
|
@@ -9391,12 +9413,12 @@ class StoreOrderRepository extends BaseRepository
|
|
9391
|
9413
|
|
|
9392
|
9414
|
$yj_amount = $spread_data['brokerage_price'] + $yj_amount_90;
|
|
9393
|
9415
|
$fgj_amount = $spread_data['fugou'] + $fgj_amount_10;
|
|
9394
|
|
- $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
|
|
|
9416
|
+ $this->fugou_user_log($spread_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1,1);
|
|
9395
|
9417
|
|
|
9396
|
9418
|
|
|
9397
|
9419
|
//Db::name('user')->where('uid',$spread_data['uid'])->update(['contribute'=> $gx_jf,'score'=> $gx_jf,'brokerage_price'=> $yj_amount,'fugou'=>$fgj_amount]);
|
|
9398
|
|
- $this->con_log($spread_data['uid'],round($pv * 0.03,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值");
|
|
9399
|
|
- $this->score_log($spread_data['uid'],round($pv * 0.03,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分");
|
|
|
9420
|
+ $this->con_log($spread_data['uid'],round($pv * 0.03,2),$store_order_data['order_id'],11,"推广会员专区商品赠送贡献值",1);
|
|
|
9421
|
+ $this->score_log($spread_data['uid'],round($pv * 0.03,2),$store_order_data['order_id'],11,"推广会员专区商品赠送积分",1);
|
|
9400
|
9422
|
//推广佣金
|
|
9401
|
9423
|
$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']);
|
|
9402
|
9424
|
}
|
|
|
@@ -9420,7 +9442,7 @@ class StoreOrderRepository extends BaseRepository
|
|
9420
|
9442
|
|
|
9421
|
9443
|
$yj_amount = $merchant_data['brokerage_price'] + $yj_amount_90;
|
|
9422
|
9444
|
$fgj_amount = $merchant_data['fugou'] + $fgj_amount_10;
|
|
9423
|
|
- $this->fugou_user_log($merchant_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1);
|
|
|
9445
|
+ $this->fugou_user_log($merchant_data['uid'],$fgj_amount_10,$store_order_data['order_id'],1,1);
|
|
9424
|
9446
|
|
|
9425
|
9447
|
|
|
9426
|
9448
|
|