From 52a4d0b64e9dbd553e2d633bd3f6ad4fe3d611da Mon Sep 17 00:00:00 2001 From: hellcat Date: Sun, 15 Mar 2026 17:32:18 +0800 Subject: [PATCH] no message --- app/Services/Tg/Hook/Dog.php | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/app/Services/Tg/Hook/Dog.php b/app/Services/Tg/Hook/Dog.php index a0dd2e5f..f81edef6 100755 --- a/app/Services/Tg/Hook/Dog.php +++ b/app/Services/Tg/Hook/Dog.php @@ -441,6 +441,56 @@ private function _getLimit() return $iLimit; } + public function last() + { + $iLastId = $this->oModelSelf->orderBy("id", "desc")->first()?->id; + + $aParam = []; + $aParam["aOption"][1] = "id"; + $aParam["aArg"][1] = $iLastId; + + return $this->find($aParam); + } + + public function hitRaw($aParam) + { + $xId = $aParam["aArg"][1] ?? false; + $sField = $aParam["aOption"][1] ?? false; + + if (!$xId) { + return "需要id"; + } + + if (!$sField) { + return "需要field"; + } + + if ($xId == "?") { + return "#hitRaw__[field] [id]"; + } + + $sContent = $this->oModelSelf->where("id", $xId)->first()?->{$sField}; + + return $sContent; + } + + public function findRaw($aParam) + { + $xId = $aParam["aArg"][1] ?? false; + + if (!$xId) { + return "需要id"; + } + + if ($xId == "?") { + return "#findRaw [id]"; + } + + $aData = $this->oModelSelf->where("id", $xId)->first()->toArray(); + + return $this->toJson($aData); + } + public function find($aParam) { $sField = $aParam["aOption"][1] ?? $this->sPrimaryKey;