diff --git a/app/Services/Tg/Hook/Dog.php b/app/Services/Tg/Hook/Dog.php index 89b6ac10..b11dceee 100755 --- a/app/Services/Tg/Hook/Dog.php +++ b/app/Services/Tg/Hook/Dog.php @@ -784,15 +784,23 @@ public function jsonSet($aParam) $aJson = json_decode($sJson, true); if ($sJson == "?") { - return "#jsonSet__[id(主键)]__[field] [json]"; + return "#jsonSet__[id]__[field] [json]"; } - $aParam = []; - $aParam["aOption"][1] = $iId; - $aParam["aOption"][2] = $sField; - $aParam["aArg"][1] = $aJson; + if (!$iId || !$sField || !$sJson) { + return "参数不足"; + } - return $this->set($aParam); + $oModelSelf = $this->oModelSelf->where("id", $iId)->first(); + + if (!$oModelSelf) { + return "没有这个"; + } + + $oModelSelf->$sField = $aJson; + $oModelSelf->save(); + + return $this->find($oModelSelf->id); } public function schemaAdd($aParam)