no message

This commit is contained in:
hellcat 2026-03-15 17:08:34 +08:00
parent 1ef7196dad
commit 5bcc9309b3
2 changed files with 32 additions and 23 deletions

View File

@ -25,7 +25,7 @@ use App\Services\TomTool\Flow;
set: set:
setSiteCode() setSiteCode()
setSiteGoupCode() setSiteGroupCode()
action: action:
del($sCmdKey) del($sCmdKey)
@ -160,7 +160,7 @@ final class Cmd
$this->_syncAuto(); $this->_syncAuto();
return $oFlow->done(); return $oFlow->done($this->oArticle->id);
} }
private function _syncAuto() private function _syncAuto()

View File

@ -30,7 +30,6 @@ class Arma extends Base {
public function new($aParam) public function new($aParam)
{ {
$sSiteGroup = $aParam["aArg"][1] ?? ""; $sSiteGroup = $aParam["aArg"][1] ?? "";
// $sSiteCode = $aParam["aArg"][2] ?? "";
$sCmdType = "put"; $sCmdType = "put";
if ($sSiteGroup == "?") { if ($sSiteGroup == "?") {
@ -44,12 +43,11 @@ class Arma extends Base {
$aOpt = []; $aOpt = [];
if ($sSiteGroup == "fn_b") { if ($sSiteGroup == "fn_b") {
$aOpt = [ $aOpt = [
// "sSlug" => "windows8691",
"sCategoryName" => "Windows", "sCategoryName" => "Windows",
"iIsTop" => 0, "iIsTop" => "skip",
"iLikeCount" => 0, "iLikeCount" => "skip",
"i7like" => 0, "i7like" => "skip",
"i365like" => 0, "i365like" => "skip",
"sTag" => "clash,ssr", "sTag" => "clash,ssr",
]; ];
} }
@ -57,29 +55,40 @@ class Arma extends Base {
$sTime = time(); $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->code = $sSiteGroup.'-'.$sTime;
$this->oDog->oModelSelf->group_code = $sSiteGroup; $this->oDog->oModelSelf->group_code = $sSiteGroup;
$this->oDog->oModelSelf->cmd = $sCmdJson;
$this->oDog->oModelSelf->opt = $sOpt; $this->oDog->oModelSelf->opt = $sOpt;
$this->oDog->oModelSelf->save(); $this->oDog->oModelSelf->save();
ServiceArticleCmd::startWithO($this->oDog->oModelSelf)->setSiteGroupCode($sSiteGroup)->syncOpen()->save($sCmdType);
return $this->toJson($this->oDog->oModelSelf); 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) public function thumbUse($aParam)
{ {
$iId = $aParam["aOption"][1] ?? 0; $iId = $aParam["aOption"][1] ?? 0;