no message
This commit is contained in:
parent
09cce78e48
commit
93ec4ab8d7
@ -1204,7 +1204,7 @@ final class Cron
|
|||||||
foreach ($oPlanExpireQueueList as $oPlanExpireQueue)
|
foreach ($oPlanExpireQueueList as $oPlanExpireQueue)
|
||||||
{
|
{
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
|
|
||||||
// DB::beginTransaction();
|
// DB::beginTransaction();
|
||||||
|
|
||||||
@ -1222,52 +1222,52 @@ final class Cron
|
|||||||
|
|
||||||
//// activated转移到expired
|
//// activated转移到expired
|
||||||
// $oPlanActivated = PlanActivated::where("user_id", $oPlanExpireQueue->user_id)->first(); // 必然有,没有自然报错,user唯一
|
// $oPlanActivated = PlanActivated::where("user_id", $oPlanExpireQueue->user_id)->first(); // 必然有,没有自然报错,user唯一
|
||||||
$oPlanActivated = Order::where("user_id", $oPlanExpireQueue->user_id)->where("status", "activated")->first();
|
// $oPlanActivated = Order::where("user_id", $oPlanExpireQueue->user_id)->where("status", "activated")->first();
|
||||||
|
//
|
||||||
|
// if ($oPlanActivated) {
|
||||||
|
// $oPlanActivated->status = "expired";
|
||||||
|
// $oPlanActivated->_save();
|
||||||
|
//// self::plan_activatedToExpired($oPlanActivated);
|
||||||
|
// }
|
||||||
|
// //// end
|
||||||
|
//
|
||||||
|
// //// 通知
|
||||||
|
// if ($reset_traffic >= 0) { // 如果设置了那个,付费用户过期转成体验用户。没设置就直接转普通用户。
|
||||||
|
// $iToEnable = Tools::toGB($reset_traffic);
|
||||||
|
// $iToExpire = date('Y-m-d H:i:s', strtotime("+$reset_day days"));
|
||||||
|
// $iToClass = $iFreeClass;
|
||||||
|
// $text .= '已转为免费体验帐户,赠送' . $reset_traffic . 'GB体验流量,'.$reset_day.'天体验时长。';
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// Notification::notifyUser($oUser, $_ENV['appName'] . '-您的套餐已经过期', $text);
|
||||||
|
// } catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
|
||||||
|
// echo $e->getMessage() . PHP_EOL;
|
||||||
|
// }
|
||||||
|
// //// end
|
||||||
|
//
|
||||||
|
// $r = $oPlanExpireQueue->delete();
|
||||||
|
//
|
||||||
|
// tomd($r);
|
||||||
|
//
|
||||||
|
//// DB::commit();
|
||||||
|
//
|
||||||
|
// self::_helper_log("用户".$oUser->id."彻底过期");
|
||||||
|
|
||||||
if ($oPlanActivated) {
|
// } catch (\Exception $e) {
|
||||||
$oPlanActivated->status = "expired";
|
//
|
||||||
$oPlanActivated->_save();
|
// tomd(22222222);
|
||||||
// self::plan_activatedToExpired($oPlanActivated);
|
// DB::rollBack();
|
||||||
}
|
//
|
||||||
//// end
|
// $sMsg = self::_helper_toJson($e->getMessage());
|
||||||
|
//
|
||||||
//// 通知
|
// self::_helper_log($sMsg, self::_eToArr($e, $sMsg));
|
||||||
if ($reset_traffic >= 0) { // 如果设置了那个,付费用户过期转成体验用户。没设置就直接转普通用户。
|
//
|
||||||
$iToEnable = Tools::toGB($reset_traffic);
|
// $oPlanExpireQueue->status = "fail:planQueue_expireDone";
|
||||||
$iToExpire = date('Y-m-d H:i:s', strtotime("+$reset_day days"));
|
// $oPlanExpireQueue->type .= "_fail_".rand(1, 9999);
|
||||||
$iToClass = $iFreeClass;
|
// $oPlanExpireQueue->_save();
|
||||||
$text .= '已转为免费体验帐户,赠送' . $reset_traffic . 'GB体验流量,'.$reset_day.'天体验时长。';
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
try {
|
|
||||||
Notification::notifyUser($oUser, $_ENV['appName'] . '-您的套餐已经过期', $text);
|
|
||||||
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
|
|
||||||
echo $e->getMessage() . PHP_EOL;
|
|
||||||
}
|
|
||||||
//// end
|
|
||||||
|
|
||||||
$r = $oPlanExpireQueue->delete();
|
|
||||||
|
|
||||||
tomd($r);
|
|
||||||
|
|
||||||
// DB::commit();
|
|
||||||
|
|
||||||
self::_helper_log("用户".$oUser->id."彻底过期");
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
|
|
||||||
tomd(22222222);
|
|
||||||
DB::rollBack();
|
|
||||||
|
|
||||||
$sMsg = self::_helper_toJson($e->getMessage());
|
|
||||||
|
|
||||||
self::_helper_log($sMsg, self::_eToArr($e, $sMsg));
|
|
||||||
|
|
||||||
$oPlanExpireQueue->status = "fail:planQueue_expireDone";
|
|
||||||
$oPlanExpireQueue->type .= "_fail_".rand(1, 9999);
|
|
||||||
$oPlanExpireQueue->_save();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user