|
@@ -146,9 +146,14 @@ class Plantask extends Controller
|
|
exit;
|
|
exit;
|
|
}
|
|
}
|
|
// dump($rule);
|
|
// dump($rule);
|
|
|
|
+ //购买者业绩
|
|
|
|
+ $buyer_yeji = $this->jiesuan_yeji($order['user_id']);
|
|
|
|
+ //购买者等级
|
|
|
|
+ $buyer_rule = $this->jiesuan_daili_level($buyer_yeji);
|
|
|
|
+ $jicha_bili = $rule['bili'] - $buyer_rule['bili'];
|
|
|
|
|
|
//给直推
|
|
//给直推
|
|
- $score = bcdiv(bcmul($order['order_shouyi'],$rule['bili'],2),100,2);
|
|
|
|
|
|
+ $score = bcdiv(bcmul($order['order_shouyi'],$jicha_bili,2),100,2);
|
|
// dump($score);
|
|
// dump($score);
|
|
if($score > 0){
|
|
if($score > 0){
|
|
$rs_wallet = model('wallet')->lockChangeAccountRemain($intro_uid,'score',$score,6,$rule['name'].'代理','unishop_order',$order['id'],$order['user_id']);
|
|
$rs_wallet = model('wallet')->lockChangeAccountRemain($intro_uid,'score',$score,6,$rule['name'].'代理','unishop_order',$order['id'],$order['user_id']);
|
|
@@ -196,6 +201,16 @@ class Plantask extends Controller
|
|
'user_id' => ['IN',$user_ids],
|
|
'user_id' => ['IN',$user_ids],
|
|
];
|
|
];
|
|
$yeji = Db::name('unishop_order')->where($map)->sum('order_price');
|
|
$yeji = Db::name('unishop_order')->where($map)->sum('order_price');
|
|
|
|
+
|
|
|
|
+ //减去提现的
|
|
|
|
+ $map = [
|
|
|
|
+ 'status' => 1,
|
|
|
|
+ 'user_id' => ['IN',$user_ids],
|
|
|
|
+ ];
|
|
|
|
+ $take_cash = Db::name('user_withdraw')->where($map)->sum('score');
|
|
|
|
+
|
|
|
|
+ $yeji = $yeji - $take_cash;
|
|
|
|
+
|
|
return $yeji;
|
|
return $yeji;
|
|
}
|
|
}
|
|
|
|
|