|
|
|
|
@ -162,28 +162,28 @@ class Job
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($shop->reset() != 0 && $shop->reset_value() != 0 && $shop->reset_exp() != 0) {
|
|
|
|
|
if(time() - $shop->reset_exp() * 86400 < $bought->datetime) {
|
|
|
|
|
if(intval((time() - $bought->datetime) / 86400) % $shop->reset() == 0 && intval((time() - $bought->datetime) / 86400) != 0) {
|
|
|
|
|
echo("流量重置-".$user->id."\n");
|
|
|
|
|
$user->transfer_enable = Tools::toGB($shop->reset_value());
|
|
|
|
|
$user->u = 0;
|
|
|
|
|
$user->d = 0;
|
|
|
|
|
$user->last_day_t = 0;
|
|
|
|
|
$user->save();
|
|
|
|
|
|
|
|
|
|
$subject = Config::get('appName')."-您的流量被重置了";
|
|
|
|
|
$to = $user->email;
|
|
|
|
|
$text = "您好,根据您所订购的订单 ID:".$bought->id.",流量已经被重置为".$shop->reset_value().'GB' ;
|
|
|
|
|
try {
|
|
|
|
|
Mail::send($to, $subject, 'news/warn.tpl', [
|
|
|
|
|
"user" => $user,"text" => $text
|
|
|
|
|
], [
|
|
|
|
|
]);
|
|
|
|
|
} catch (Exception $e) {
|
|
|
|
|
echo $e->getMessage();
|
|
|
|
|
}
|
|
|
|
|
if(time() - $shop->reset_exp() * 86400 < $bought->datetime) {
|
|
|
|
|
if(intval((time() - $bought->datetime) / 86400) % $shop->reset() == 0 && intval((time() - $bought->datetime) / 86400) != 0) {
|
|
|
|
|
echo("流量重置-".$user->id."\n");
|
|
|
|
|
$user->transfer_enable = Tools::toGB($shop->reset_value());
|
|
|
|
|
$user->u = 0;
|
|
|
|
|
$user->d = 0;
|
|
|
|
|
$user->last_day_t = 0;
|
|
|
|
|
$user->save();
|
|
|
|
|
|
|
|
|
|
$subject = Config::get('appName')."-您的流量被重置了";
|
|
|
|
|
$to = $user->email;
|
|
|
|
|
$text = "您好,根据您所订购的订单 ID:".$bought->id.",流量已经被重置为".$shop->reset_value().'GB' ;
|
|
|
|
|
try {
|
|
|
|
|
Mail::send($to, $subject, 'news/warn.tpl', [
|
|
|
|
|
"user" => $user,"text" => $text
|
|
|
|
|
], [
|
|
|
|
|
]);
|
|
|
|
|
} catch (Exception $e) {
|
|
|
|
|
echo $e->getMessage();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -799,4 +799,4 @@ class Job
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|