diff --git a/app/Services/Tg/Hook/Mod/ArticleCache.php b/app/Services/Tg/Hook/Mod/ArticleCache.php index 5a50e18f..b65e6382 100755 --- a/app/Services/Tg/Hook/Mod/ArticleCache.php +++ b/app/Services/Tg/Hook/Mod/ArticleCache.php @@ -49,7 +49,7 @@ class ArticleCache extends Base { public function show($aParam) { - $xCode = $aParam["aArg"][0] ?? ":last"; + $xCode = $aParam["aArg"][1] ?? ":last"; $sCode = $xCode; if ($xCode == "?") { @@ -65,9 +65,30 @@ class ArticleCache extends Base { $a = []; foreach ($aCache as $aCacheRow) { $aContent = json_decode($aCacheRow['content'], true); - $a[] = $aContent; + $a["id:".$aCacheRow['id']] = $aContent; } return $this->toJson($a); } + + public function echo($aParam) + { + $iId = $aParam["aArg"][1] ?? ""; + + if ($iId === "?") { + return "#show__[id],show()获取id"; + } + + if (!$iId) { + return "id必须"; + } + + $oCache = ModelArticleCache::where("id", $iId)->first(); + + if (!$oCache) { + return "没找到"; + } + + return $oCache->content; + } }