no message

This commit is contained in:
hellcat 2026-07-27 18:46:48 +08:00
parent e0dd17e86c
commit a1efdb8866
3 changed files with 16 additions and 3 deletions

View File

@ -49,7 +49,7 @@ final class HookController
public function cache_tg_new() public function cache_tg_new()
{ {
$sCacheTgHook = Option::where("k", "cache_tg::hook")->first()?->v; // 做了一半 $sCacheTgHook = Option::where("k", "cache_tg_new::hook")->first()?->v; // 做了一半
if (!$sCacheTgHook) { if (!$sCacheTgHook) {
echo "$sCacheTgHook 未设置"; echo "$sCacheTgHook 未设置";

View File

@ -8,7 +8,7 @@ class Option extends Model
{ {
protected $table = 'option'; protected $table = 'option';
public $timestamps = false; public $timestamps = false;
protected $primaryKey = 'k'; // protected $primaryKey = 'k';
public $incrementing = false; public $incrementing = false;
protected $keyType = 'string'; protected $keyType = 'string';

View File

@ -14,6 +14,7 @@ use Illuminate\Support\Facades\File;
use App\Models\TelegramKey as ModelTelegramKey; use App\Models\TelegramKey as ModelTelegramKey;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use App\Services\Article\Cmd as ServiceArticleCmd; use App\Services\Article\Cmd as ServiceArticleCmd;
use App\Models\Option;
final class CacheTg final class CacheTg
{ {
@ -186,8 +187,20 @@ final class CacheTg
$oModelArticleSchema->group_code = $sGroupCode; $oModelArticleSchema->group_code = $sGroupCode;
$oModelArticleSchema->save(); $oModelArticleSchema->save();
$jDefaultThumbUse = Option::where("k", "cache_tg_new::default_thumb_use::{$sGroupCode}")->first()?->k;
if (!$aDefaultThumbUse) {
$jDefaultThumbUse = Option::where("k", "cache_tg_new::default_thumb_use")->first()?->k;
}
$aDefaultThumbUse = json_decode($jDefaultThumbUse, true);
if (!$aDefaultThumbUse) {
$aDefaultThumbUse = ["c"];
}
$oModelArticleSchema->_opt([ $oModelArticleSchema->_opt([
"thumb_use" => ['c'] "thumb_use" => $aDefaultThumbUse
]); ]);
ServiceArticleCmd::startWithO($oModelArticleSchema)->syncOpen()->save("new"); ServiceArticleCmd::startWithO($oModelArticleSchema)->syncOpen()->save("new");