diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 659fb67..6fa27e7 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -208,6 +208,17 @@ class KefuController { } } + protected function delOvertimeOpenid($accountid) + { + $conn = $this->getMysql($accountid); + error_log('del:' . $accountid); + $ret = $conn->execScript('DELETE FROM accounts ' . + 'WHERE accountid=:accountid;', + array( + ':accountid' => $accountid, + )); + } + private function sendKefuMsg($accountid, $data) { try { @@ -231,6 +242,7 @@ class KefuController { if ($ret_info['errcode'] == 40003) { //无效的openid,(更换appid appkey导致之前的openid失效) //从db里删除这种过期的openid + $this->delOvertimeOpenid($accountid); return true; } error_log('重新获取access_token');