From 0b0ea48a74ade2ddf331757ff765c6eebf9600ff Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 4 Jul 2019 19:49:25 +0800 Subject: [PATCH] 1 --- webapp/controller/KefuController.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 28f91e4..e0ee4e0 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -53,11 +53,13 @@ class KefuController { die(); return; } + error_log($response); $ret = json_decode($response, true); if ($ret['errcode'] == 0) { if ($gameid == 2001) { if (count($ret['items']) > 0) { $item = $ret['items'][rand() % count($ret['items'])]; + error_log(json_encode($item)); return array($item); } else { return $ret['items']; @@ -81,7 +83,6 @@ class KefuController { foreach ($config as $attachment) { $attachments .= $attachment['item_id'] . ':' . $attachment['count'] . ';'; } - $params = array( 'to' => $accountid, 'game_id' => phpcommon\extractGameId($accountid), @@ -133,7 +134,7 @@ class KefuController { $msg_str); if ($errcode == 0) { $msg = json_decode($msg_str, true); - //error_log(json_encode($msg)); + error_log(json_encode($msg)); $accountid = phpcommon\createAccountId(WEIXIN_CHANNEL, $_REQUEST['gameid'], $msg['FromUserName']); switch ($msg['MsgType']) { case 'event': @@ -215,6 +216,7 @@ class KefuController { return; } $ret_info = json_decode($response, true); + //error_log(json_encode($response)); return !empty($ret_info) && $ret_info['errcode'] == 0; } @@ -261,6 +263,7 @@ class KefuController { } else { $text = $msg['Content']; } + //error_log(json_encode($gameid)); $awardConfig = $this->getAwardConfig($gameid, $text); if (!isset($awardConfig)) { $this->sendKefuMsg($accountid, array (