|
@@ -1477,6 +1477,7 @@ class StoreOrderRepository extends BaseRepository
|
|
|
$all_performance = 0; //总业绩
|
|
$all_performance = 0; //总业绩
|
|
|
$ratio = $v['award_ratio']; //奖励比例
|
|
$ratio = $v['award_ratio']; //奖励比例
|
|
|
$level_price = bcmul($price, $ratio, 2); //等级奖励金额
|
|
$level_price = bcmul($price, $ratio, 2); //等级奖励金额
|
|
|
|
|
+ @file_put_contents('quanju.txt', "------------------------------------------\r\n", 8);
|
|
|
@file_put_contents('quanju.txt', $level_price . "-团队奖励等级奖励金额\r\n", 8);
|
|
@file_put_contents('quanju.txt', $level_price . "-团队奖励等级奖励金额\r\n", 8);
|
|
|
foreach ($group_info as &$value) { //遍历上级统计总业绩
|
|
foreach ($group_info as &$value) { //遍历上级统计总业绩
|
|
|
if ($value[$field] >= $v['level']) { //判断是否达到该等级
|
|
if ($value[$field] >= $v['level']) { //判断是否达到该等级
|
|
@@ -1490,10 +1491,12 @@ class StoreOrderRepository extends BaseRepository
|
|
|
$all_performance = bcadd($all_performance, $performance, 2);
|
|
$all_performance = bcadd($all_performance, $performance, 2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ @file_put_contents('quanju.txt', $all_performance . "-团队奖励所有人总业绩\r\n", 8);
|
|
|
foreach ($group_info as &$value) { //遍历上级分红
|
|
foreach ($group_info as &$value) { //遍历上级分红
|
|
|
$user_retio = bcdiv($value['performance'], $all_performance, 2); //用户奖励比例
|
|
$user_retio = bcdiv($value['performance'], $all_performance, 2); //用户奖励比例
|
|
|
@file_put_contents('quanju.txt', $value['uid'] . "-团队奖励分红uid\r\n", 8);
|
|
@file_put_contents('quanju.txt', $value['uid'] . "-团队奖励分红uid\r\n", 8);
|
|
|
@file_put_contents('quanju.txt', $user_retio . "-团队奖励业绩分红比例\r\n", 8);
|
|
@file_put_contents('quanju.txt', $user_retio . "-团队奖励业绩分红比例\r\n", 8);
|
|
|
|
|
+ @file_put_contents('quanju.txt', $value['performance'] . "-团队奖励个人\r\n", 8);
|
|
|
$user_reward = bcmul($level_price, $user_retio, 2); //用户奖励金额
|
|
$user_reward = bcmul($level_price, $user_retio, 2); //用户奖励金额
|
|
|
$user_integral = bcdiv($user_reward, $integral_price['price'], 2); //用户奖励积分
|
|
$user_integral = bcdiv($user_reward, $integral_price['price'], 2); //用户奖励积分
|
|
|
$after = bcadd($value['award_integral'], $user_integral, 2); //更新用户奖励积分
|
|
$after = bcadd($value['award_integral'], $user_integral, 2); //更新用户奖励积分
|
|
@@ -1507,6 +1510,7 @@ class StoreOrderRepository extends BaseRepository
|
|
|
'link_id' => $order['order_id'],
|
|
'link_id' => $order['order_id'],
|
|
|
'mark' => $value['nickname'] . '获得'.$v['name'].'等级的分红积分'.$user_integral ,
|
|
'mark' => $value['nickname'] . '获得'.$v['name'].'等级的分红积分'.$user_integral ,
|
|
|
]);
|
|
]);
|
|
|
|
|
+ User::where('uid', $value['uid'])->update(['award_integral' => $after]);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|