no message
This commit is contained in:
parent
e2f88d1980
commit
52a4d0b64e
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user