mirror of
https://github.com/v2board/v2board.git
synced 2025-02-11 07:59:11 +08:00
update: fix order update
This commit is contained in:
parent
3600c9a166
commit
b26a3e0e70
@ -83,6 +83,7 @@ class OrderController extends Controller
|
|||||||
if (!$orderService->success(time())) {
|
if (!$orderService->success(time())) {
|
||||||
abort(500, '更新失败');
|
abort(500, '更新失败');
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case 2: {
|
case 2: {
|
||||||
if (!$orderService->cancel()) {
|
if (!$orderService->cancel()) {
|
||||||
|
@ -12,7 +12,8 @@ class MailService
|
|||||||
public function remindTraffic (User $user)
|
public function remindTraffic (User $user)
|
||||||
{
|
{
|
||||||
if (!$user->remind_traffic) return;
|
if (!$user->remind_traffic) return;
|
||||||
if (!$this->remindTrafficIsWarnValue(($user->u + $user->d), $user->transfer_enable)) return;
|
$trafficTotal = $user->u + $user->d;
|
||||||
|
if (!$this->remindTrafficIsWarnValue($user->u, $user->d, $user->transfer_enable)) return;
|
||||||
$flag = CacheKey::get('LAST_SEND_EMAIL_REMIND_TRAFFIC', $user->id);
|
$flag = CacheKey::get('LAST_SEND_EMAIL_REMIND_TRAFFIC', $user->id);
|
||||||
if (Cache::get($flag)) return;
|
if (Cache::get($flag)) return;
|
||||||
if (!Cache::put($flag, 1, 24 * 3600)) return;
|
if (!Cache::put($flag, 1, 24 * 3600)) return;
|
||||||
@ -27,8 +28,9 @@ class MailService
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function remindTrafficIsWarnValue($ud, $transfer_enable)
|
private function remindTrafficIsWarnValue($u, $d, $transfer_enable)
|
||||||
{
|
{
|
||||||
|
$ud = $u + $d;
|
||||||
if (!$ud) return false;
|
if (!$ud) return false;
|
||||||
if (!$transfer_enable) return false;
|
if (!$transfer_enable) return false;
|
||||||
$percentage = ($ud / $transfer_enable) * 100;
|
$percentage = ($ud / $transfer_enable) * 100;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user