diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 50a220e..aa19232 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -28,6 +28,16 @@ class KefuController { return $conn; } + private function translateAttachments($config) + { + $attachments = ''; + foreach ($config as $attachment) { + $attachments .= $attachment['item_id'] . ':' . $attachment['count'] . ';'; + } + return $attachments; + } + + private function getAwardConfig($gameid, $condition) { $url = ''; @@ -47,7 +57,6 @@ class KefuController { if ($ret['errcode'] == 0) { return $ret['items']; } else { - die(); return; } } @@ -232,11 +241,12 @@ class KefuController { } foreach ($rows as $row) { $shareInfo = require('../config/kefu.share.config.php'); + $gameid = phpcommon/extractGameId($row['accountid']); $this->sendKefuMsg($userInfo['accountid'], array ( "touser" => $row['openid'], "msgtype" => "miniprogrampage", - "miniprogrampage" =>$shareInfo['1011'] + "miniprogrampage" =>$shareInfo[$gameid] )); if ($row['idx'] > $last_idx) { @@ -300,8 +310,8 @@ class KefuController { $conn = $this->getMysql($accountid); $ret = $conn->execScript('INSERT INTO accounts_kefu(accountid, channel, gameid, openid, awardtime) ' . 'SELECT :accountid, :channel, :gameid, :openid, :awardtime ' . - 'FROM accounts_kefu ' . - 'WHERE NOT EXISTS(SELECT accountid FROM accounts_kefu WHERE accoutid=:accountid);', + 'FROM DUAL ' . + 'WHERE NOT EXISTS(SELECT accountid FROM accounts_kefu WHERE accountid=:accountid);', array( ':accountid' => $accountid, ':channel' => WEIXIN_CHANNEL,