This commit is contained in:
Tokumeikoi 2020-11-07 16:04:42 +08:00
parent 1d92d6b2f9
commit 93c90ddaf0
2 changed files with 7 additions and 3 deletions

View File

@ -29,7 +29,7 @@ class MailService
private function remindTrafficIsWarnValue($ud, $transfer_enable)
{
if ($ud <= 0) return false;
if (!$ud) return false;
if (!$transfer_enable) return false;
$percentage = ($ud / $transfer_enable) * 100;
if ($percentage < 80) return false;

View File

@ -88,8 +88,12 @@ class UserService
if (!$user->save()) {
return false;
}
$mailService = new MailService();
$mailService->remindTraffic($user);
try {
$mailService = new MailService();
$mailService->remindTraffic($user);
} catch (\Exception $e) {
return true;
}
return true;
}
}