From 44e2cdfc46d5ab34daff661b494b939f52ffd6ba Mon Sep 17 00:00:00 2001 From: tping Date: Wed, 25 Nov 2020 17:28:31 +0800 Subject: [PATCH] =?UTF-8?q?1126=20=E5=AE=A2=E6=9C=8DQQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/GameController.class.php | 24 +++++++++++++------ .../Sdk/Controller/NoticeController.class.php | 12 ++++++++++ .../Sdk/Controller/UserController.class.php | 4 ++++ 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Application/Sdk/Controller/GameController.class.php b/Application/Sdk/Controller/GameController.class.php index 2edaccbc..a4072737 100644 --- a/Application/Sdk/Controller/GameController.class.php +++ b/Application/Sdk/Controller/GameController.class.php @@ -40,14 +40,24 @@ class GameController extends BaseController{ public function init_sdk() { $data = json_decode(base64_decode(file_get_contents("php://input")), true); - /* if (I('debug') == 1) { - $data['user_id'] = 1; - $data['sdk_version'] = 2; - } */ + + $game = M('game', 'tab_')->where([ + 'id' => $data['game_id'] + ])->order('sort desc')->find(); $contact_cs = M('tool','tab_')->where(['name' => 'contact_cs'])->find(); $contact_cs = json_decode($contact_cs['config'],true); foreach($contact_cs as $k => &$v) { + if ($game['kefu_qq_type'] == 0) + $kefuQQ = C('APP_QQ'); + if ($game['kefu_qq_type'] == 1) + $kefuQQ = ''; + if ($game['kefu_qq_type'] == 2) + $kefuQQ = $game['kefu_qq']; + + $contact_cs[$k]['act'] = $kefuQQ; + $contact_cs[$k]['ios_url'] = $kefuQQ; + $contact_cs[$k]['icon'] = C('ADMIN_DOMAIN') . $contact_cs[$k]['icon']; // if (substr($contact_cs[$k]['url'], 0, 7) == "http://" || substr($contact_cs[$k]['url'], 0, 8) == "https://") { @@ -99,11 +109,11 @@ class GameController extends BaseController{ } array_multisort(array_column($contact_cs,'sort'),SORT_ASC,$menus); - $ret = [ + $contact_cs[$k]['act'] = "mqq://im/chat?chat_type=wpa&uin=" . "123456456" . "&version=1&src_type=web"; + + $ret = [ 'contact_cs' => $contact_cs[$k], ]; - /* if (I('debug') == 1) - pp(($ret)); */ re_msg(200,'获取成功',$ret); } diff --git a/Application/Sdk/Controller/NoticeController.class.php b/Application/Sdk/Controller/NoticeController.class.php index 7a788f5c..9a4c7378 100644 --- a/Application/Sdk/Controller/NoticeController.class.php +++ b/Application/Sdk/Controller/NoticeController.class.php @@ -408,6 +408,18 @@ class NoticeController extends BaseController{ $data['QQ_GROUP_KEY'] = C('QQ_GROUP_KEY'); $data['APP_QQ_GROUP'] = C('APP_QQ_GROUP'); $data['APP_EMAIL'] = C('APP_EMAIL'); + + $game = M('game', 'tab_')->where([ + 'id' => $request['game_id'] + ])->order('sort desc')->find(); + + if ($game['kefu_qq_type'] == 0) + $data['APP_QQ'] = C('APP_QQ'); + if ($game['kefu_qq_type'] == 1) + $data['APP_QQ'] = ''; + if ($game['kefu_qq_type'] == 2) + $data['APP_QQ'] = $game['kefu_qq']; + // 魔幻游戏 隐藏客服 if ($request['game_id'] == 197 || $request['game_id'] == 198 || $request['game_id'] == 201 || $request['game_id'] == 202 // 马踏乱世 diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index a3ad8ea9..63381927 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -2935,6 +2935,10 @@ class UserController extends BaseController $request = json_decode(base64_decode(file_get_contents("php://input")), true); + if (!isset($request['unique_code'])) { + $this -> new_set_message(200, "", []); + } + $device_record = M('device_record', 'tab_'); $map = array( 'unique_code' => $request['unique_code'],