From 94480951cb377e24e32f3e916ea2243ce6a1b215 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 6 Nov 2019 10:55:42 +0800 Subject: [PATCH 1/3] =?UTF-8?q?OA=E8=8E=B7=E5=8F=96=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Conf/config.php | 3 ++ .../Controller/FengHuoApiController.class.php | 16 ++++++-- .../GetInfoBaseController.class.php | 39 +++++++++++++++++++ .../Sdk/Controller/OAController.class.php | 4 +- 4 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 Application/Sdk/Controller/GetInfoBaseController.class.php diff --git a/Application/Sdk/Conf/config.php b/Application/Sdk/Conf/config.php index 6ca9ed729..94d64a1b6 100644 --- a/Application/Sdk/Conf/config.php +++ b/Application/Sdk/Conf/config.php @@ -23,6 +23,9 @@ return array( 'DATA_CACHE_PREFIX' => 'onethink_', // 缓存前缀 'DATA_CACHE_TYPE' => 'File', // 数据缓存类型 + /*获取信息加密KEY*/ + 'GET_INFO_KEY' => 'wmkjtx_kj213', + /* 文件上传相关配置 */ 'DOWNLOAD_UPLOAD' => array( 'mimes' => '', //允许上传的文件MiMe类型 diff --git a/Application/Sdk/Controller/FengHuoApiController.class.php b/Application/Sdk/Controller/FengHuoApiController.class.php index 264aa5440..1518f145c 100644 --- a/Application/Sdk/Controller/FengHuoApiController.class.php +++ b/Application/Sdk/Controller/FengHuoApiController.class.php @@ -5,11 +5,11 @@ * Date: 2019/8/5 * Time: 16:04 */ -namespace SDK\Controller; +namespace Sdk\Controller; use Think\Controller; use Think\Log; -class FengHuoApiController extends Controller{ +class FengHuoApiController extends GetInfoBaseController{ // protected function _initialize(){ // // 制定允许其他域名访问 // header("Access-Control-Allow-Origin:*"); @@ -76,7 +76,7 @@ class FengHuoApiController extends Controller{ // 默认排序:id降序 $order = 'register_time asc'; $data = M('user','tab_') - ->field('id,account,promote_account,register_ip,register_time,device_type,device_number') + ->field('id,account,promote_account,register_ip,register_time,device_type,device_number','fgame_name') ->where($where) ->order($order) ->page($page, $row) @@ -87,6 +87,15 @@ class FengHuoApiController extends Controller{ $data[$k]['device_type'] = 'Android'; }elseif($bindType == 2) { $data[$k]['device_type'] = 'IOS'; + }else{ + if(!empty($v['fgame_name'])){ + $gameServer = substr($v['fgame_name'], -10, 9); + if($gameServer == '安卓版'){ + $data[$k]['device_type'] = 'Android'; + } elseif($gameServer == '苹果版') { + $data[$k]['device_type'] = 'Android'; + } + } } } @@ -104,7 +113,6 @@ class FengHuoApiController extends Controller{ 'Data' => 'null' ]; } - Log::write('registerDetail:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO'); return $this->ajaxReturn($result); diff --git a/Application/Sdk/Controller/GetInfoBaseController.class.php b/Application/Sdk/Controller/GetInfoBaseController.class.php new file mode 100644 index 000000000..fbc05acf6 --- /dev/null +++ b/Application/Sdk/Controller/GetInfoBaseController.class.php @@ -0,0 +1,39 @@ + $data['time_stamp']) { + $result = [ + 'ResultCode' => 2002, + 'ResultMessage' => "链接已过期", + 'Data' => 'null', + ]; + return $this->ajaxReturn($result); + } else { + $sign = $data['sign']; + unset($data['sign']); + ksort($data); + reset($data); + $str = ""; + foreach ($data as $k => $v) { + $str = $str . $k . "=" . $v; + } + $str = $str . 'key=' . C('GET_INFO_KEY'); + if (md5($str) != $sign) { + $result = [ + 'ResultCode' => 2001, + 'ResultMessage' => "参数错误", + 'Data' => 'null', + ]; + return $this->ajaxReturn($result); + } + } + } +} diff --git a/Application/Sdk/Controller/OAController.class.php b/Application/Sdk/Controller/OAController.class.php index 079614137..502209a29 100644 --- a/Application/Sdk/Controller/OAController.class.php +++ b/Application/Sdk/Controller/OAController.class.php @@ -5,10 +5,10 @@ * Date: 2016/11/4 * Time: 16:04 */ -namespace SDK\Controller; +namespace Sdk\Controller; use Think\Controller; -class OAController extends Controller{ +class OAController extends GetInfoBaseController{ /** * 游戏列表接口 From 93bbc57ef2f30a41352d23535684c5211707063e Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 6 Nov 2019 10:58:22 +0800 Subject: [PATCH 2/3] =?UTF-8?q?OA=E8=8E=B7=E5=8F=96=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Controller/FengHuoApiController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/Sdk/Controller/FengHuoApiController.class.php b/Application/Sdk/Controller/FengHuoApiController.class.php index 1518f145c..7412bbb66 100644 --- a/Application/Sdk/Controller/FengHuoApiController.class.php +++ b/Application/Sdk/Controller/FengHuoApiController.class.php @@ -93,7 +93,7 @@ class FengHuoApiController extends GetInfoBaseController{ if($gameServer == '安卓版'){ $data[$k]['device_type'] = 'Android'; } elseif($gameServer == '苹果版') { - $data[$k]['device_type'] = 'Android'; + $data[$k]['device_type'] = 'IOS'; } } } From 90105716d55f62927afa65d21aa1a8249ed28d01 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 6 Nov 2019 11:12:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?OA=E8=8E=B7=E5=8F=96=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FengHuoApi2Controller.class.php | 341 ++++++++++++++++++ .../Controller/FengHuoApiController.class.php | 2 +- .../Sdk/Controller/OAController.class.php | 2 +- 3 files changed, 343 insertions(+), 2 deletions(-) create mode 100644 Application/Sdk/Controller/FengHuoApi2Controller.class.php diff --git a/Application/Sdk/Controller/FengHuoApi2Controller.class.php b/Application/Sdk/Controller/FengHuoApi2Controller.class.php new file mode 100644 index 000000000..804cec207 --- /dev/null +++ b/Application/Sdk/Controller/FengHuoApi2Controller.class.php @@ -0,0 +1,341 @@ +ajaxReturn(array("ResultCode"=>0,"ResultMessage"=>"缺少必要的参数","Data"=>"null")); +// } +// +// +// $signData = array($appId,$page,$pageSize,$signatureStamp,$time); +// $md5_sign = md5(http_build_query($signData).$key); +// +// +// if($md5Sign != $md5_sign){ +// return $this->ajaxReturn(array("ResultCode"=>0,"ResultMessage"=>"验签失败")); +// } +// $endSignatureStamp = intval(time()) + 600; +// if($signatureStamp > $endSignatureStamp){ +// return $this->ajaxReturn(array("ResultCode"=>0,"ResultMessage"=>"请求超时")); +// } +// +// $pageSize = intval($pageSize); +// if($pageSize > 1000){ +// return $this->ajaxReturn(array("ResultCode"=>0,"ResultMessage"=>"每页数量数值过大")); +// } +// } + + /** + * 注册明细 + * @param + */ + public function registerDetail(){ + + $time = $_REQUEST['time']; + $page = $_REQUEST['page']; + $pageSize = $_REQUEST['page_size']; + + //时间区间 + if (isset($time)) { + $where['register_time'] = array('between',[$time,$time+86399]); + } + +// 第几页数据 + $page = intval($page); + $page = $page ? $page : 1; //默认显示第一页数据 +// 一页显示数据的条数 + $pageSize = intval($pageSize); + $row = $pageSize ? $pageSize : 1000; +// 默认排序:id降序 + $order = 'register_time asc'; + $data = M('user','tab_') + ->field('id,account,promote_account,register_ip,register_time,device_type,device_number','fgame_name') + ->where($where) + ->order($order) + ->page($page, $row) + ->select(); + foreach ($data as $k => $v) { + $bindType = $v['device_type']; + if ($bindType == 1) { + $data[$k]['device_type'] = 'Android'; + }elseif($bindType == 2) { + $data[$k]['device_type'] = 'IOS'; + }else{ + if(!empty($v['fgame_name'])){ + $gameServer = substr($v['fgame_name'], -10, 9); + if($gameServer == '安卓版'){ + $data[$k]['device_type'] = 'Android'; + } elseif($gameServer == '苹果版') { + $data[$k]['device_type'] = 'IOS'; + } + } + } + + } + + if($data){ + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => "调用成功", + 'Data' => $data + ]; + }else{ + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => "没有数据,换个条件试试吧", + 'Data' => 'null' + ]; + } + Log::write('registerDetail:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO'); + + return $this->ajaxReturn($result); + } + + /** + * 支付明细 + * @param + */ + public function payDetail(){ + + $time = $_REQUEST['time']; + $page = $_REQUEST['page']; + $pageSize = $_REQUEST['page_size']; + + //时间区间 + if (isset($time)) { + $where['pay_time'] = array('between',[$time,$time+86399]); + } +// 第几页数据 + $page = intval($page); + $page = $page ? $page : 1; //默认显示第一页数据 +// 一页显示数据的条数 + $pageSize = intval($pageSize); + $row = $pageSize ? $pageSize : 1000; +// 默认排序:id降序 + $order = 'pay_time asc'; + $where['pay_status'] = array('neq',0); + + $data = M('spend','tab_') + ->field('pay_order_number,promote_account,user_id,game_name,game_player_name,server_name,pay_time,cost,user_account') + ->where($where) + ->order($order) + ->page($page, $row) + ->select(); + + if($data){ + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => '调用成功', + 'Data' => $data + ]; + }else{ + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => '没有数据,换个条件试试吧', + 'Data' => 'null' + ]; + } + + Log::write('payDetail:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO'); + + return $this->ajaxReturn($result); + + } + + /** + * 玩家角色信息 + * @param + */ + public function roleInfo(){ + + $time = $_REQUEST['time']; + $page = $_REQUEST['page']; + $pageSize = $_REQUEST['page_size']; + //时间区间 + if (isset($time)) { + $where['play_time'] = array('between',[$time,$time+86399]); + } +// 第几页数据 + $page = intval($page); + $page = $page ? $page : 1; //默认显示第一页数据 +// 一页显示数据的条数 + $pageSize = intval($pageSize); + $row = $pageSize ? $pageSize : 1000; +// 默认排序:id降序 + $order = 'play_time asc'; + $data = M('user_play_info','tab_') + ->field('promote_account,user_id,game_name,server_name,role_name,role_level,play_time,role_id,user_account') + ->where($where) + ->order($order) + ->page($page, $row) + ->select(); + + if($data){ + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => "调用成功", + 'Data' => $data + ]; + }else{ + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => "没有数据,换换条件吧", + 'Data' => 'null' + ]; + } + + Log::write('roleInfo:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO'); + + return $this->ajaxReturn($result); + + } + + /** + * 玩家登陆信息 + * @param + */ + public function loginInfo(){ + + $time = $_REQUEST['time']; + $page = $_REQUEST['page']; + $pageSize = $_REQUEST['page_size']; + + //时间区间 + if (isset($time)) { + $where['login_time'] = array('between',[$time,$time+86399]); + } +// 第几页数据 + $page = intval($page); + $page = $page ? $page : 1; //默认显示第一页数据 +// 一页显示数据的条数 + $pageSize = intval($pageSize); + $row = $pageSize ? $pageSize : 1000; +// 默认排序:id降序 + $order = 'login_time asc'; + + $where['login_time'] = array('neq',0); + + $data = M('user_login_record','tab_') + ->field('user_id,game_name,server_name,login_time,user_account,game_player_name') + ->where($where) + ->order($order) + ->page($page, $row) + ->select(); + foreach ($data as $k=>$v){ + $promoteId = $v['promote_id']; + if($promoteId == 0){ + $data[$k]['promote_account'] = '官方渠道'; + }else{ + $promote_account = M('promote','tab_') + ->field('account') + ->where('id',$promoteId) + ->find(); + $data[$k]['promote_account'] = $promote_account; + } + + } + + if($data){ + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => "调用成功", + 'Data' => $data + ]; + }else{ + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => "没有数据,换个条件试试吧", + ]; + } + + Log::write('loginInfo:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO'); + + return $this->ajaxReturn($result); + + } + + /** + * 换绑记录 + * @param + */ + public function bindHistory() + { + + $time = $_REQUEST['time']; + $page = $_REQUEST['page']; + $pageSize = $_REQUEST['page_size']; + + //时间区间 + if (isset($time)) { + $where['m.create_time'] = array('between', [$time, $time + 86399]); + } +// 第几页数据 + $page = intval($page); + $page = $page ? $page : 1; //默认显示第一页数据 +// 一页显示数据的条数 + $pageSize = intval($pageSize); + $row = $pageSize ? $pageSize : 1000; +// 默认排序:id降序 + $order = 'm.create_time asc'; + $data = M('mend as m', 'tab_') + ->join('tab_user as u on m.user_id = u.id','LEFT') + ->field('m.user_id,m.create_time,m.promote_account,m.promote_account_to,m.bind_type,m.user_account,u.register_time') + ->where($where) + ->order($order) + ->page($page, $row) + ->select(); + + foreach ($data as $k => $v) { + $bindType = $v['bind_type']; + if ($bindType == 1) { + $data[$k]['bind_type'] = 'In'; + }elseif($bindType == 2){ + $data[$k]['bind_type'] = 'Out'; + } + + } + if ($data) { + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => "调用成功", + 'Data' => $data + ]; + } else { + $result = [ + 'ResultCode' => 1, + 'ResultMessage' => "没有数据,换个条件试试吧", + ]; + } + + Log::write('bindHistory:' . date('Y-m-d H:i:s') . ' ---- ' . json_encode($result), 'INFO'); + + return $this->ajaxReturn($result); + } +} \ No newline at end of file diff --git a/Application/Sdk/Controller/FengHuoApiController.class.php b/Application/Sdk/Controller/FengHuoApiController.class.php index 7412bbb66..6507ca8cd 100644 --- a/Application/Sdk/Controller/FengHuoApiController.class.php +++ b/Application/Sdk/Controller/FengHuoApiController.class.php @@ -9,7 +9,7 @@ namespace Sdk\Controller; use Think\Controller; use Think\Log; -class FengHuoApiController extends GetInfoBaseController{ +class FengHuoApiController extends Controller{ // protected function _initialize(){ // // 制定允许其他域名访问 // header("Access-Control-Allow-Origin:*"); diff --git a/Application/Sdk/Controller/OAController.class.php b/Application/Sdk/Controller/OAController.class.php index 502209a29..7e8a8641c 100644 --- a/Application/Sdk/Controller/OAController.class.php +++ b/Application/Sdk/Controller/OAController.class.php @@ -8,7 +8,7 @@ namespace Sdk\Controller; use Think\Controller; -class OAController extends GetInfoBaseController{ +class OAController extends Controller{ /** * 游戏列表接口