no message

This commit is contained in:
hellcat 2025-06-17 15:06:51 +08:00
parent 9dd211f3b5
commit e8b783d29c
2 changed files with 60 additions and 4 deletions

View File

@ -343,7 +343,9 @@ class SakaiController
$s = "/dove#check cfn";
$s = "/dove%zzz";
$s = "/dove%cmd#list";
$s = "/dove#add xxx";
$s = "/dove#set__xxx__memo fff";
$s = "/dove#del xxx";

View File

@ -11,7 +11,7 @@ class Dove extends Base {
public function go($aParam, $aData)
{
$oDoveSiteCheckedList = ModelDoveSite::where("dove_checked", 1)->get();
//tomd($aData, 1);
list(, $sSubCmd) = explode("%", $aData['message']['text'], 2);
$aData['message']['text'] = $sSubCmd;
@ -32,7 +32,61 @@ class Dove extends Base {
}
return $r;
}
public function del($aParam)
{
$sCode = $aParam["aArg"][1] ?? false;
if (!$sCode) {
return "要code";
}
$oDove = ModelDoveSite::where("code", $sCode)->first();
if (!$oDove) {
return "没有";
}
$oDove->delete();
return $this->list();
}
public function add($aParam)
{
$sCode = $aParam["aArg"][1];
$oDove = new ModelDoveSite();
$oDove->code = $sCode;
$oDove->save();
return $this->list();
}
public function set($aParam)
{
$sCode = $aParam["aOption"][1] ?? false;
$k = $aParam["aOption"][2] ?? false;
$v = $aParam["aArg"][1] ?? false;
if (!$sCode) {
return "需要code";
}
$oDove = ModelDoveSite::where("code", $sCode)->first();
if (!$oDove) {
return "没有";
}
$oDove->$k = $v;
$oDove->save();
return $this->toJson($oDove);
}
public function list()
@ -68,7 +122,7 @@ class Dove extends Base {
return $r;
}
public function uncheck()
public function checkClear()
{
$r = ModelDoveSite::query()->update(["dove_checked" => 0]);
@ -76,7 +130,7 @@ class Dove extends Base {
return $this->now();
}
public function unset($aParam)
public function uncheck($aParam)
{
$aParam['iSetValue'] = 0;
$r = $this->set($aParam);