Commit aed4a2d7 by 冷斌

fix bug

parent 24c9fce0
......@@ -814,14 +814,14 @@ class PayAction extends CommonAction
if ($user['binding_uid'] <= 0) {
return ;
}
$num = M('el_user')->where(array('binding_uid' => $recharge['binding_uid']))->count();
$num = M('el_user')->where(array('binding_uid' => $user['binding_uid']))->count();
$level = [
// 0 => 0.1,
// 50 => 0.2,
// 180 => 0.3
0 => 0.1,
1 => 0.2,
2 => 0.3,
1 => 0.1,
2 => 0.2,
3 => 0.3,
];
$r = 0;
foreach ($level as $time => $rate) {
......@@ -831,11 +831,11 @@ class PayAction extends CommonAction
}
//$money = $recharge['money'] * $r;
$money = 100 * $r;
$zy_split_balance = M('zy_split_balance')->where(array('uid' => $recharge['invite_id']))->find();
$zy_split_balance = M('zy_split_balance')->where(array('uid' => $user['binding_uid']))->find();
$nn = $zy_split_balance['balance'] + $money;
M('zy_split_balance')->where(array('uid' => $recharge['invite_id']))->save(['balance' => $nn]);
M('zy_split_balance')->where(array('uid' => $user['binding_uid']))->save(['balance' => $nn]);
M('zy_split_balance_flow')->add([
'uid' => $recharge['invite_id'],
'uid' => $user['binding_uid'],
'type' => 5,
'num' => $money,
'balance' => $money,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment