|
@@ -42,6 +42,9 @@ class IntegralJob extends BaseJobs
|
|
|
// //添加静态积分
|
|
|
// $static_integral_ratio = sys_config('static_integral_ratio', 0);
|
|
|
$rate = sys_config('static_integral_rate', 3);
|
|
|
+ $award_order_limit = 0.01;
|
|
|
+ $award_order_limit_type = system('award_order_limit_type');
|
|
|
+ if ($award_order_limit_type == 0) $award_order_limit = sys_config('award_order_limit');
|
|
|
$give_static_integral = bcmul($total_price, $rate);
|
|
|
if ($give_static_integral > 0) {
|
|
|
// $extract_sum = bcmul($total_price, $rate, 2);
|
|
@@ -60,7 +63,7 @@ class IntegralJob extends BaseJobs
|
|
|
$rate = sys_config('action_integral_rate', 3);
|
|
|
$spread = $userService->getUserInfo($user['spread_uid']);
|
|
|
if ($spread && $spread['is_promoter']) {
|
|
|
- if ($awardIntegralService->getPaySum($spread['uid']) > 0) {
|
|
|
+ if ($awardIntegralService->getPaySum($spread['uid']) >= $award_order_limit) {
|
|
|
$award_ratio = sys_config('recommend_integral', 0);
|
|
|
if (($integral_info['link_id'] ?? 0) > 0) {
|
|
|
$award_ratio = sys_config('reorder_recommend_integral', 0);
|
|
@@ -73,7 +76,7 @@ class IntegralJob extends BaseJobs
|
|
|
// $awardIntegralService->incIntegral($spread['uid'], $integral_price, $give_action_integral, $total_price, 1, $extract_sum, $order['id'], $mark);
|
|
|
}
|
|
|
}
|
|
|
- if ($awardIntegralService->getPaySum($spread['uid']) > 0) {
|
|
|
+ if ($awardIntegralService->getPaySum($spread['uid']) >= $award_order_limit) {
|
|
|
$award_ratio = sys_config('recommend_speed_integral', 0);
|
|
|
$give_action_integral = bcdiv(bcmul($total_price, $award_ratio), 100, 2);
|
|
|
if ($give_action_integral > 0) {
|
|
@@ -95,7 +98,7 @@ class IntegralJob extends BaseJobs
|
|
|
$give_action_integral = bcdiv(bcmul($total_price, $ratio), 100, 2);
|
|
|
if ($give_action_integral > $send && $spread['is_promoter']) {
|
|
|
$real_send = bcsub($give_action_integral, $send, 2);
|
|
|
- if ($awardIntegralService->getPaySum($spread['uid']) > 0 || $spread['award_switch']) {
|
|
|
+ if ($awardIntegralService->getPaySum($spread['uid']) >= $award_order_limit || $spread['award_switch']) {
|
|
|
$extract_sum = bcmul($real_send, $rate, 2);
|
|
|
$mark = '团队用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得团队级差积分';
|
|
|
$this->sendAward($extract_sum, $spread['uid'], $mark, $order['id']);
|