|
@@ -85,6 +85,7 @@ class IntegralJob extends BaseJobs
|
|
|
$pass[] = $spread['uid'];
|
|
|
$spread = $userService->getUserInfo($spread['spread_uid']);
|
|
|
}
|
|
|
+ $this->autoExtract($awardIntegralService->getPrice());
|
|
|
return true;
|
|
|
} catch (\Throwable $e) {
|
|
|
Log::error('处理积分奖池失败,失败原因:' . $e->getMessage());
|
|
@@ -148,7 +149,7 @@ class IntegralJob extends BaseJobs
|
|
|
|
|
|
$res = $res && $awardIntegralService->update($info['id'], ['handle' => 0, 'extract_sum_real' => $sum, 'status' => 1, 'extract_time' => time()]);
|
|
|
}
|
|
|
- return $res;
|
|
|
+ return $res && $this->autoExtract($awardIntegralService->getPrice());
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -163,18 +164,17 @@ class IntegralJob extends BaseJobs
|
|
|
$billService = app()->make(UserBillServices::class);
|
|
|
/** @var UserServices $userService */
|
|
|
$userService = app()->make(UserServices::class);
|
|
|
- $info = $awardIntegralService->getIntegralsOverExtract($price);
|
|
|
- return $awardIntegralService->transaction(function () use ($info, $awardIntegralService, $brokerageService, $billService, $userService) {
|
|
|
+ $infos = $awardIntegralService->getIntegralsOverExtract($price);
|
|
|
+ $res = true;
|
|
|
+ foreach ($infos as $info) {
|
|
|
if ($info['status'] != 0) {
|
|
|
$awardIntegralService->update($info['id'], ['handle' => 0]);
|
|
|
- return true;
|
|
|
+ continue;
|
|
|
}
|
|
|
- $price = $awardIntegralService->getPrice();
|
|
|
$sum = bcmul($price, $info['num'], 2);
|
|
|
if ($sum > $info['extract_sum']) {
|
|
|
$sum = $info['extract_sum'];
|
|
|
}
|
|
|
- $res = true;
|
|
|
$real_out = bcdiv(bcmul($sum, sys_config('extract_ratio', 0)), 100, 2);
|
|
|
if ($real_out > 0) {
|
|
|
$user = $userService->getUserInfo($info['uid']);
|
|
@@ -203,11 +203,10 @@ class IntegralJob extends BaseJobs
|
|
|
], $balance, $info['id']);
|
|
|
// 添加用户佣金
|
|
|
$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()]);
|
|
|
}
|
|
|
- return $res;
|
|
|
- });
|
|
|
+ }
|
|
|
+ return $res;
|
|
|
}
|
|
|
|
|
|
/**
|