This commit is contained in:
aozhiwei 2019-10-24 14:09:23 +08:00
parent 2cee273b56
commit 3e86e77179

View File

@ -224,6 +224,7 @@ class KefuController {
try {
$gameid = phpcommon\extractGameId($accountid);
$access_token = $this->getAccessToken($gameid);
error_log($access_token);
$url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" . urlencode($access_token);
$response = '';
@ -279,7 +280,7 @@ class KefuController {
' FROM accounts WHERE activetime > :time AND idx > :last_idx LIMIT 0, 1000;',
array(
':last_idx' => $last_idx,
':time' => time() - 3600 * 24
':time' => time() - 3600 * 6
));
if (!$rows || count($rows) <= 0) {
break;
@ -352,7 +353,7 @@ class KefuController {
));
return;
}
$this->updateActiveTime($conn);
$this->updateActiveTime($conn, $accountid);
if ($this->sendAwardMail($accountid, $awardConfig)) {
$ret = $conn->execScript('UPDATE accounts SET ' .
' awardtime=:awardtime ' .
@ -388,17 +389,17 @@ class KefuController {
':accountid' => $accountid,
':channel' => WEIXIN_CHANNEL,
':gameid' => phpcommon\extractGameId($accountid),
':openid' => $msg['FromUserName'],
':openid' => phpcommon\extractOpenId($accountid),
':awardtime' => 0,
':activetime' => 0
));
if ($ret) {
/*if ($ret) {
$this->sendKefuMsg($accountid, array(
"touser" => $msg['FromUserName'],
"msgtype" => "text",
//"text" => array("content" => "您好,有什么能帮助你? \n ")
));
}
}*/
}
private function getAccessToken($gameid)
@ -457,7 +458,7 @@ class KefuController {
}
}
protected function updateActiveTime($conn)
protected function updateActiveTime($conn, $accountid)
{
$ret = $conn->execScript('UPDATE accounts SET ' .
' activetime=:activetime ' .