* code for bind dinguserid.

This commit is contained in:
wangyidong
2019-11-22 17:00:02 +08:00
parent 18a4c9220f
commit 303b48c1bb
3 changed files with 12 additions and 2 deletions
+3 -1
View File
@@ -221,6 +221,8 @@ class webhookModel extends model
public function bind($webhookID)
{
$data = fixer::input('post')->get();
$this->dao->delete()->from(TABLE_DINGUSERID)->where('account')->in(array_keys($data->userid))->exec();
foreach($data->userid as $account => $userid)
{
if(empty($userid)) continue;
@@ -229,7 +231,7 @@ class webhookModel extends model
$dingUser->webhook = $webhookID;
$dingUser->account = $account;
$dingUser->userid = $userid;
$this->dao->replace(TABLE_DINGUSERID)->data($dingUser)->exec();
$this->dao->insert(TABLE_DINGUSERID)->data($dingUser)->exec();
}
return !dao::isError();
}