diff --git a/app/Command/Job.php b/app/Command/Job.php index f7ac4ae7..7ec47668 100644 --- a/app/Command/Job.php +++ b/app/Command/Job.php @@ -593,8 +593,7 @@ class Job Radius::Delete($user->email); } - - if (strtotime($user->expire_in) < time()) { + if (strtotime($user->expire_in) < time()&&!file_exists(BASE_PATH."/storage/".$node->id.".expire_in")) { $user->transfer_enable = 0; $user->u = 0; $user->d = 0; @@ -611,7 +610,15 @@ class Job } catch (\Exception $e) { echo $e->getMessage(); } + $myfile = fopen(BASE_PATH."/storage/".$node->id.".expire_in", "w+") or die("Unable to open file!"); + $txt = "1"; + fwrite($myfile, $txt); + fclose($myfile); } + elseif (strtotime($user->expire_in) > time()&&file_exists(BASE_PATH."/storage/".$node->id.".expire_in")) { + unlink(BASE_PATH."/storage/".$node->id.".expire_in"); + } + //余量不足检测 if(!file_exists(BASE_PATH."/storage/traffic_notified/")){ diff --git a/app/Utils/URL.php b/app/Utils/URL.php index bdbc45ae..2d4592b9 100644 --- a/app/Utils/URL.php +++ b/app/Utils/URL.php @@ -304,10 +304,11 @@ class URL } public static function getAllUrl($user, $is_mu, $is_ss = 0, $enter = 0) { $return_url = ''; - if ($user->transfer_enable >0){ - $return_url .= URL::getUserTraffic($user, $is_mu).($enter == 0 ? ' ' : "\n"); - $return_url .= URL::getUserClassExpiration($user, $is_mu).($enter == 0 ? ' ' : "\n"); - } + $return_url .= URL::getUserTraffic($user, $is_mu).($enter == 0 ? ' ' : "\n"); + $return_url .= URL::getUserClassExpiration($user, $is_mu).($enter == 0 ? ' ' : "\n"); + if(strtotime($user->expire_in)