From 5bcc9309b3744865019aa1f0f8b0294648ba7c38 Mon Sep 17 00:00:00 2001 From: hellcat Date: Sun, 15 Mar 2026 17:08:34 +0800 Subject: [PATCH] no message --- app/Services/Article/Cmd.php | 4 +-- app/Services/Tg/Hook/Mod/Arma.php | 51 ++++++++++++++++++------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/app/Services/Article/Cmd.php b/app/Services/Article/Cmd.php index f4fecb45..c2057b6c 100755 --- a/app/Services/Article/Cmd.php +++ b/app/Services/Article/Cmd.php @@ -25,7 +25,7 @@ use App\Services\TomTool\Flow; set: setSiteCode() - setSiteGoupCode() + setSiteGroupCode() action: del($sCmdKey) @@ -160,7 +160,7 @@ final class Cmd $this->_syncAuto(); - return $oFlow->done(); + return $oFlow->done($this->oArticle->id); } private function _syncAuto() diff --git a/app/Services/Tg/Hook/Mod/Arma.php b/app/Services/Tg/Hook/Mod/Arma.php index b81f74f1..e6111ba9 100755 --- a/app/Services/Tg/Hook/Mod/Arma.php +++ b/app/Services/Tg/Hook/Mod/Arma.php @@ -30,7 +30,6 @@ class Arma extends Base { public function new($aParam) { $sSiteGroup = $aParam["aArg"][1] ?? ""; -// $sSiteCode = $aParam["aArg"][2] ?? ""; $sCmdType = "put"; if ($sSiteGroup == "?") { @@ -44,12 +43,11 @@ class Arma extends Base { $aOpt = []; if ($sSiteGroup == "fn_b") { $aOpt = [ -// "sSlug" => "windows8691", "sCategoryName" => "Windows", - "iIsTop" => 0, - "iLikeCount" => 0, - "i7like" => 0, - "i365like" => 0, + "iIsTop" => "skip", + "iLikeCount" => "skip", + "i7like" => "skip", + "i365like" => "skip", "sTag" => "clash,ssr", ]; } @@ -57,29 +55,40 @@ class Arma extends Base { $sTime = time(); - $oSites = ModelSiteMap::where("group_code", $sSiteGroup)->get(); - - $aCmdJson = []; - foreach ($oSites as $oSite) { - $sKey = "|{$sSiteGroup}|{$oSite->code}|".date("YmdHis", $sTime)."|"; - $aCmdJson[$sKey] = [ - "site_code" => $oSite->code, - "cmd" => "put", - "value" => "", - "date" => date("Y-m-d H:i:s", $sTime) - ]; - } - $sCmdJson = json_encode($aCmdJson); - $this->oDog->oModelSelf->code = $sSiteGroup.'-'.$sTime; $this->oDog->oModelSelf->group_code = $sSiteGroup; - $this->oDog->oModelSelf->cmd = $sCmdJson; $this->oDog->oModelSelf->opt = $sOpt; $this->oDog->oModelSelf->save(); + ServiceArticleCmd::startWithO($this->oDog->oModelSelf)->setSiteGroupCode($sSiteGroup)->syncOpen()->save($sCmdType); + return $this->toJson($this->oDog->oModelSelf); } + public function cmd($aParam) + { + $id = $aParam["aOption"][1] ?? false; + $sSiteGroup = $aParam["aArg"][1] ?? false; + $sCmdType = $aParam["aArg"][2] ?? "put"; + + if ($sSiteGroup === "?") { + return "#cmd__[id] [siteGroupCode] [cmd:put]"; + } + + if (!$id || !$sSiteGroup) { + return "参数不足"; + } + + $oArticle = ModelArticleSchema::where("id", $id)->first(); + + ServiceArticleCmd::startWithO($oArticle)->setSiteGroupCode($sSiteGroup)->syncOpen()->save($sCmdType); + + $aArticle = $oArticle->toArray(); + unset($aArticle["schema"]); + + return $this->toJson($aArticle); + } + public function thumbUse($aParam) { $iId = $aParam["aOption"][1] ?? 0;