Browse Source

会员升级

Kirin 1 year ago
parent
commit
e2e68403c1
1 changed files with 3 additions and 30 deletions
  1. 3 30
      app/jobs/integral/IntegralJob.php

+ 3 - 30
app/jobs/integral/IntegralJob.php

@@ -70,10 +70,8 @@ class IntegralJob extends BaseJobs
                         $give_action_integral = bcdiv(bcmul($total_price, $award_ratio), 100, 2);
                         if ($give_action_integral > 0) {
                             $first = $awardIntegralService->getFirstStaticIntegral($spread['uid']);
-                            if ($first) {
-                                $mark = ',推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得加速积分';
-                                $awardIntegralService->incUpdateIntegral($first['id'], $integral_price, $give_action_integral, $mark);
-                            }
+                            $mark = ',推荐用户' . $user['nickname'] . "({$user['uid']})" . '购买商品,获得加速积分';
+                            $awardIntegralService->incUpdateIntegral($first['id'], $integral_price, $give_action_integral, $mark);
                         }
                     }
                 }
@@ -191,20 +189,8 @@ class IntegralJob extends BaseJobs
                 $sum = $info['extract_sum'];
             }
             $real_out = bcdiv(bcmul($sum, sys_config('extract_ratio', 0)), 100, 2);
-//            $left = bcsub($info['num'], bcdiv(bcmul($info['num'], sys_config('extract_ratio', 0)), 100, 2), 5);
-//            $to_top = bcdiv(bcmul($left, sys_config('extract_speed_ratio', 0)), 100, 5);
-//            $num = sys_config('extract_speed_num', 0);
-//            if ($num > 0) {
-//                $to_top = bcdiv($to_top, $num, 5);
-//            } else {
-//                $to_top = 0;
-//            }
-//            $to_spread = 0;
-//            if ($info['type'] == 0) {
-//                $to_spread = bcdiv(bcmul($info['num'], sys_config('extract_spread_ratio', 0)), 100, 2);
-//            }
-            $user = $userService->getUserInfo($info['uid']);
             if ($real_out > 0) {
+                $user = $userService->getUserInfo($info['uid']);
                 $mark = '用户积分出局,出局时价格' . $price;
                 $res = $res && $awardIntegralService->addLake(-$real_out, $info['id'], $mark);
 
@@ -232,19 +218,6 @@ class IntegralJob extends BaseJobs
                 $res = $res && $userService->bcInc($info['uid'], 'energy', $to_energy, 'uid');
                 $res = $res && $awardIntegralService->update($info['id'], ['handle' => 0, 'extract_sum_real' => $sum, 'status' => 1, 'extract_time' => time()]);
             }
-//            if ($to_top > 0) {
-//
-//            }
-//            if ($to_spread > 0) {
-//                $spread = $userService->getUserInfo($user['spread_uid']);
-//                if ($spread) {
-//                    $first = $awardIntegralService->getFirstStaticIntegral($spread['uid']);
-//                    if ($first) {
-//                        $mark = ',推荐用户' . $user['nickname'] . "({$user['uid']})" . '消费分出局,获得加速积分';
-//                        $awardIntegralService->incUpdateIntegral($first['id'], $integral_price, $give_action_integral, $mark);
-//                    }
-//                }
-//            }
         }
         if (count($infos) > 0) return $res && $this->autoExtract($awardIntegralService->getPrice());
         return $res;