diff --git a/src/Services/Cron.php b/src/Services/Cron.php index 4c4eef51c..e0340549f 100755 --- a/src/Services/Cron.php +++ b/src/Services/Cron.php @@ -899,7 +899,8 @@ final class Cron public static function orderToPlan(): void { self::_helper_log("支付完成 - 开始"); - + $oTelegramV2 = new TelegramV2(); + $oTelegramV2->send(["xxx"=>"ggg"], "arr"); $iPayClass = $_ENV["user_payClass"]; $pending_payment_orders = (new Order())->where('status', 'payment_pending')->get(); // 这里还是无脑检索order了,但是现在order表可以只保留一年内数据,问题不大 @@ -917,19 +918,18 @@ final class Cron continue; } + $oUser = User::find($invoice->user_id); + + if (!$oUser) { + continue; + } + DB::beginTransaction(); try { // 付款完成后 if (in_array($invoice->status, ['paid_gateway', 'paid_balance', 'paid_admin'])) { - - $oUser = User::find($invoice->user_id); - - if (!$oUser) { - DB::commit(); - continue; - } $iPayAmount = $invoice->price - $invoice->money_use;