no message

This commit is contained in:
hellcat 2026-04-28 13:23:29 +08:00
parent 04e22ac7eb
commit a864d6aede

View File

@ -418,19 +418,19 @@ final class Cron
// echo $e->getMessage() . PHP_EOL; // echo $e->getMessage() . PHP_EOL;
// } // }
// //
if (Config::obtain('telegram_node_offline')) { // if (Config::obtain('telegram_node_offline')) {
$notice_text = str_replace( // $notice_text = str_replace(
'%node_name%', // '%node_name%',
$node->name, // $node->name,
Config::obtain('telegram_node_offline_text') // Config::obtain('telegram_node_offline_text')
); // );
//
try { // try {
(new Telegram())->send(0, $notice_text); // (new Telegram())->send(0, $notice_text);
} catch (TelegramSDKException $e) { // } catch (TelegramSDKException $e) {
echo $e->getMessage(); // echo $e->getMessage();
} // }
} // }
$node->online = 0; $node->online = 0;
$node->save(); $node->save();
@ -1591,7 +1591,7 @@ final class Cron
$oTgSendFormat->sTitleEmoji = "\n\n"; $oTgSendFormat->sTitleEmoji = "\n\n";
$oTgSendFormat->sTitle = "# 机器流量"; $oTgSendFormat->sTitle = "# 机器流量";
$oServers = Node::where('type', 2)->get(); $oServers = Node::where('type', 2)->orderBy('order_group')->get();
if ($oServers->isEmpty()) { if ($oServers->isEmpty()) {
return; return;
@ -1630,7 +1630,12 @@ final class Cron
} }
foreach ($aZhuanfaToday as $sZhuanfaCode => $iZhuanfaWidthToday) { foreach ($aZhuanfaToday as $sZhuanfaCode => $iZhuanfaWidthToday) {
$oZhuanfa = Zhuanfas::updateOrCreate(['code' => $sZhuanfaCode]);
$oZhuanfa = Zhuanfas::firstOrCreate(
['code' => $sZhuanfaCode], // 查询条件
['name' => $sZhuanfaName] // 只有在创建新记录时,这些字段才会被写入
);
$oZhuanfa->today_width = $iZhuanfaWidthToday; // 这个覆盖是可以的,因为这是当前周期的总量 $oZhuanfa->today_width = $iZhuanfaWidthToday; // 这个覆盖是可以的,因为这是当前周期的总量
$oZhuanfa->save(); $oZhuanfa->save();
$oZhuanfa->increment('use_width', $iZhuanfaWidthToday); // 这里使用原子递增 $oZhuanfa->increment('use_width', $iZhuanfaWidthToday); // 这里使用原子递增