1
This commit is contained in:
parent
146762afee
commit
0b0ea48a74
@ -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 (
|
||||
|
Loading…
x
Reference in New Issue
Block a user