From d607d557928a9405eed7e6f9302e3c4206ae3fc1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 28 Jan 2019 16:38:36 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/controller/KefuController.class.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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,