no message
This commit is contained in:
parent
9dd211f3b5
commit
e8b783d29c
@ -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";
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user