diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 4408a1f..7d5a832 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -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 ' .