|
@@ -57,25 +57,25 @@ class IntegralJob extends BaseJobs
|
|
|
$spread = $userService->getUserInfo($user['spread_uid']);
|
|
|
if ($spread) {
|
|
|
if ($awardIntegralService->getPaySum($spread['uid']) >= 1000 || $awardIntegralService->getHourExtractPaySum($spread['uid'], 24) >= 1000) {
|
|
|
-// if ($awardIntegralService->getPaySum($spread['uid']) > 0) {
|
|
|
-// $award_ratio = sys_config('recommend_integral', 0);
|
|
|
-// $award_speed_ratio = sys_config('recommend_speed_integral', 0);
|
|
|
-// $award_ratio = bcadd($award_ratio, $award_speed_ratio, 2);
|
|
|
-// $give_action_integral = bcdiv(bcmul($award_price, $award_ratio), 100, 2);
|
|
|
-// if ($give_action_integral > 0) {
|
|
|
-// $first = $awardIntegralService->getFirstStaticIntegral($spread['uid']);
|
|
|
-// $mark = ',推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得加速积分';
|
|
|
-// $awardIntegralService->incUpdateIntegral($first['id'], $integral_price, $give_action_integral, $mark);
|
|
|
-// }
|
|
|
-// } else {
|
|
|
- $award_ratio = sys_config('recommend_integral', 0);
|
|
|
- $give_action_integral = bcdiv(bcmul($award_price, $award_ratio), 100, 2);
|
|
|
- if ($give_action_integral > 0) {
|
|
|
- $extract_sum = bcmul($give_action_integral, $rate, 2);
|
|
|
- $mark = '推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得推荐积分';
|
|
|
- $awardIntegralService->incIntegral($spread['uid'], $integral_price, $give_action_integral, $total_price, 1, $extract_sum, $order['id'], $mark);
|
|
|
+ if ($awardIntegralService->getPaySum($spread['uid']) > 0) {
|
|
|
+ $award_ratio = sys_config('recommend_integral', 0);
|
|
|
+ $award_speed_ratio = sys_config('recommend_speed_integral', 0);
|
|
|
+ $award_ratio = bcadd($award_ratio, $award_speed_ratio, 2);
|
|
|
+ $give_action_integral = bcdiv(bcmul($award_price, $award_ratio), 100, 2);
|
|
|
+ if ($give_action_integral > 0) {
|
|
|
+ $first = $awardIntegralService->getFirstStaticIntegral($spread['uid']);
|
|
|
+ $mark = ',推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得加速积分';
|
|
|
+ $awardIntegralService->incUpdateIntegral($first['id'], $integral_price, $give_action_integral, $mark);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $award_ratio = sys_config('recommend_integral', 0);
|
|
|
+ $give_action_integral = bcdiv(bcmul($award_price, $award_ratio), 100, 2);
|
|
|
+ if ($give_action_integral > 0) {
|
|
|
+ $extract_sum = bcmul($give_action_integral, $rate, 2);
|
|
|
+ $mark = '推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得推荐积分';
|
|
|
+ $awardIntegralService->incIntegral($spread['uid'], $integral_price, $give_action_integral, $total_price, 1, $extract_sum, $order['id'], $mark);
|
|
|
+ }
|
|
|
}
|
|
|
-// }
|
|
|
}
|
|
|
}
|
|
|
$levelServices->detection((int)$user['uid']);
|