From 146762afee385e91befc1acb02668a2991eb387e Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 4 Jul 2019 16:48:38 +0800 Subject: [PATCH] 1 --- webapp/controller/KefuController.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index e8901d1..28f91e4 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -55,7 +55,16 @@ class KefuController { } $ret = json_decode($response, true); if ($ret['errcode'] == 0) { - return $ret['items']; + if ($gameid == 2001) { + if (count($ret['items']) > 0) { + $item = $ret['items'][rand() % count($ret['items'])]; + return array($item); + } else { + return $ret['items']; + } + } else { + return $ret['items']; + } } else { return; }