From 1931bd61977fc134c670e6b35974e95821e2b9dd Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Mon, 30 Sep 2019 23:49:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Controller/HomeController.class.php | 57 +++++++++++++++++++ Application/User/Api/MemberApi.class.php | 7 ++- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index 8b3c61d2a..b41ee879c 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -18,6 +18,7 @@ namespace Home\Controller; use Think\Controller; +use User\Api\MemberApi; /** * 前台公共控制器 @@ -192,4 +193,60 @@ class HomeController extends Controller $this->assign('data', $data); $this->display(); } + + public function register() + { + $userApi = new MemberApi(); + $id = $userApi->wap_register($_POST); + if ($id > 0) { + $this->add_user_play($_POST); + $this->ajaxReturn([ + 'status' => true, + 'msg' => '注册成功' + ]); + } else { + $this->ajaxReturn([ + 'status' => false, + 'msg' => '数据有误' + ]); + } + } + + /** + *添加玩家信息 + */ + private function add_user_play($user = array()) + { + + $user_play = M("UserPlay", "tab_"); + $map["game_id"] = $user["game_id"]; + $map["user_id"] = $user["user_id"]; + $map['sdk_version'] = $user['sdk_version']; + $res = $user_play -> where($map) -> find(); + if (empty($res)) { + $user_entity = get_user_entity($user["user_id"]); + $data["user_id"] = $user["user_id"]; + $data["user_account"] = $user_entity["account"]; + $data["user_nickname"] = $user_entity["nickname"]; + $data["game_id"] = $user["game_id"]; + $data["game_appid"] = $user["game_appid"]; + $data["game_name"] = get_game_name($user["game_id"]); + $data["server_id"] = 0; + $data["server_name"] = ""; + $data["role_id"] = 0; + $data['parent_id'] = $user_entity["parent_id"]; + $data['parent_name'] = $user_entity["parent_name"]; + $data["role_name"] = ""; + $data["role_level"] = 0; + $data["bind_balance"] = 0; + $data["promote_id"] = $user_entity["promote_id"]; + $data["promote_account"] = $user_entity["promote_account"]; + $data['play_time'] = time(); + $data['play_ip'] = get_client_ip(); + $data["sdk_version"] = $user["sdk_version"]; + $data['ppuid'] = $user['puid'] == '' ? 0 : $user['puid']; + $data['check_time'] = time(); + $user_play -> add($data); + } + } } diff --git a/Application/User/Api/MemberApi.class.php b/Application/User/Api/MemberApi.class.php index 011f8ed8e..6df0a929c 100644 --- a/Application/User/Api/MemberApi.class.php +++ b/Application/User/Api/MemberApi.class.php @@ -29,9 +29,14 @@ class MemberApi extends Api{ return $this->model->register($data); } - public function sdk_register($data){ + public function sdk_register($data){ return $this->model->sdk_register($data); } + + public function wap_register($data){ + return $this->model->wap_register($data); + } + /** * 注册一个新用户user表加game_id * @param string $account 用户名 From 9fdbdc539efed9bf45a39db4f8a587a1ab835d7f Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Tue, 1 Oct 2019 00:02:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9oa=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/FengHuoApiController.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Application/Sdk/Controller/FengHuoApiController.class.php b/Application/Sdk/Controller/FengHuoApiController.class.php index 4fd168f79..264aa5440 100644 --- a/Application/Sdk/Controller/FengHuoApiController.class.php +++ b/Application/Sdk/Controller/FengHuoApiController.class.php @@ -74,7 +74,7 @@ class FengHuoApiController extends Controller{ $pageSize = intval($pageSize); $row = $pageSize ? $pageSize : 1000; // 默认排序:id降序 - $order = 'id desc'; + $order = 'register_time asc'; $data = M('user','tab_') ->field('id,account,promote_account,register_ip,register_time,device_type,device_number') ->where($where) @@ -131,7 +131,7 @@ class FengHuoApiController extends Controller{ $pageSize = intval($pageSize); $row = $pageSize ? $pageSize : 1000; // 默认排序:id降序 - $order = 'id desc'; + $order = 'pay_time asc'; $where['pay_status'] = array('neq',0); $data = M('spend','tab_') @@ -181,7 +181,7 @@ class FengHuoApiController extends Controller{ $pageSize = intval($pageSize); $row = $pageSize ? $pageSize : 1000; // 默认排序:id降序 - $order = 'id desc'; + $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) @@ -230,7 +230,7 @@ class FengHuoApiController extends Controller{ $pageSize = intval($pageSize); $row = $pageSize ? $pageSize : 1000; // 默认排序:id降序 - $order = 'id desc'; + $order = 'login_time asc'; $where['login_time'] = array('neq',0); @@ -295,7 +295,7 @@ class FengHuoApiController extends Controller{ $pageSize = intval($pageSize); $row = $pageSize ? $pageSize : 1000; // 默认排序:id降序 - $order = 'm.id desc'; + $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')