no message

This commit is contained in:
hellcat 2025-10-22 09:31:54 +08:00
parent 4261fa7aa6
commit c015376907

View File

@ -926,6 +926,11 @@ final class Cron
$oUser = User::find($invoice->user_id);
if (!$oUser) {
DB::commit();
continue;
}
$iPayAmount = $invoice->price - $invoice->money_use;
if ($oOrder->product_code == "code") { // 钱包充值
@ -1105,13 +1110,19 @@ final class Cron
$oProduct = Product::where("code", $oPlanPending->product_code)->first(); // * 商品表
$oUser = User::find($oPlanQueue->user_id);
if (!$oUser) {
DB::commit();
continue;
}
// 没有对应商品时
if (!$oProduct) {
$oPlanPending->error_code = "fail";
$oPlanPending->error_str = "激活失败,该商品已从数据库存中移除,金额以退回至钱包。";
// 退回钱包
$oUser = User::find($oPlanQueue->user_id);
$iUserMoneyOld = $oUser->money;
$iUserMoneyNew = $oUser->money + $oPlanPending->user_price;
@ -1136,8 +1147,6 @@ final class Cron
//// 用户激活
$oProductContent = json_decode($oProduct->content);
$oUser = User::find($oPlanQueue->user_id);
self::_plan_to_user($oUser, $oProductContent); // 套餐赋予用户
@ -1203,7 +1212,7 @@ final class Cron
// 检查自动续订是否开启
$oUser = User::where("id", $oPlanQueue->user_id)->first(); // * 数据
if ($oUser->autorenew != 1) {
if (!$oUser || $oUser->autorenew != 1) {
continue;
}
@ -1324,6 +1333,11 @@ final class Cron
$oUser = User::where("id", $oPlanExpireQueue->user_id)->first();
if (!$oUser) {
DB::commit();
continue;
}
//// activated转移到expired
// $oPlanActivated = PlanActivated::where("user_id", $oPlanExpireQueue->user_id)->first(); // 必然有没有自然报错user唯一
$oPlanActivated = Order::where("user_id", $oPlanExpireQueue->user_id)->where("status", "activated")->first(); // 没有就不管,只过期用户
@ -1436,20 +1450,20 @@ final class Cron
//
// }
// private static function _eToArr($oError, $sTitle = false)
// {
// $arr = [];
//
// if ($sTitle) {
// $arr['title'] = $sTitle;
// }
//
// $arr['code'] = $oError->getCode();
// $arr['file'] = $oError->getFile();
// $arr['line'] = $oError->getLine();
//
// return $arr;
// }
private static function _eToArr($oError, $sTitle = false)
{
$arr = [];
if ($sTitle) {
$arr['title'] = $sTitle;
}
$arr['code'] = $oError->getCode();
$arr['file'] = $oError->getFile();
$arr['line'] = $oError->getLine();
return $arr;
}
private static function _helper_log($sMsg, $sTgMsg = false)
{