From 68d6b39b5de5cc049cc75e1398d36be5dac4f0d3 Mon Sep 17 00:00:00 2001 From: tping Date: Tue, 10 Mar 2020 15:37:19 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=20device=5Frecord=20=20?= =?UTF-8?q?=20=E5=9C=A8=E7=BA=BF=E6=97=B6=E9=95=BF=E4=B8=8D=E5=81=9A?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Controller/UserController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index ea243953..c74ef79e 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -2791,8 +2791,8 @@ class UserController extends BaseController $map = array( 'unique_code' => $request['unique_code'], ); - - $result = $device_record -> where($map) -> order('create_time desc') -> find(); + $duration = 0; + /* $result = $device_record -> where($map) -> order('create_time desc') -> find(); $duration = 0; $now = time(); if (is_array($result) && $result['mark'] == 1) { @@ -2809,7 +2809,7 @@ class UserController extends BaseController } - } + } */ // 在线时长不做统计 $request['user_id'] = (!empty($request['user_id'])) ? $request['user_id'] : 0; $data = array( From 33ab2a88e35f6d52facf11c3865fb01169a42a50 Mon Sep 17 00:00:00 2001 From: tping Date: Tue, 10 Mar 2020 16:15:55 +0800 Subject: [PATCH 2/4] =?UTF-8?q?//=20=E5=8F=96=E6=B6=88=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=99=BB=E5=85=A5=E8=AE=B0=E5=BD=95=E7=9A=84=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Sdk/Controller/UserController.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index c74ef79e..edf51821 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -1416,7 +1416,7 @@ class UserController extends BaseController log_action($log); if ($res['id']>0) { $user_play->save($data); - $this->updateLoginRecord($data); +// $this->updateLoginRecord($data); // 取消更新登入记录的角色相关信息 } else { $data['create_time'] = time(); $data['create_ip'] = get_client_ip(); @@ -1431,7 +1431,7 @@ class UserController extends BaseController Log::write('Duplicate Exception:' .json_encode($e->getMessage()), Log::ERR); } - $this->updateLoginRecord($data); + // $this->updateLoginRecord($data); // 取消更新登入记录的角色相关信息 } From cba6dde69fd20f5e15dceaccdd80d0f397201f4a Mon Sep 17 00:00:00 2001 From: tping Date: Tue, 10 Mar 2020 17:09:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E7=BA=BF?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/UserController.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Application/Sdk/Controller/UserController.class.php b/Application/Sdk/Controller/UserController.class.php index edf51821..6e126689 100644 --- a/Application/Sdk/Controller/UserController.class.php +++ b/Application/Sdk/Controller/UserController.class.php @@ -2466,7 +2466,7 @@ class UserController extends BaseController $log['type'] = 4; log_action($log); - // $return = M('UserLoginRecord', 'tab_') -> add($da); + /* // $return = M('UserLoginRecord', 'tab_') -> add($da); $model = M('UserLoginRecord', 'tab_')->where(['user_id' => $user['id'],'game_id' => $request['game_id']])->order('id DESC')->find(); M('UserLoginRecord', 'tab_')->where(['id' => $model['id']])->setField(['down_time' => NOW_TIME]); if ($request['state'] == 1) { @@ -2478,7 +2478,19 @@ class UserController extends BaseController // $this -> set_message(0, "fail", "数据新增失败!"); - // } + // } */ + $return = M('UserGameLoginRecord', 'tab_') -> add($da); + if ($return) { + if ($request['state'] == 1) { + M('nearby', 'tab_') -> where(['user_id' => $user['id']]) -> setField(['update_time' => time(), 'game_status' => 0]); + } + echo base64_encode(json_encode(array('status' => 200, 'return_msg' => '数据新增成功!'))); + + } else { + + $this -> set_message(0, "fail", "数据新增失败!"); + + } } From 14219a4762c345795eb29dbc8f7b95a3e8d7f9fb Mon Sep 17 00:00:00 2001 From: tping Date: Fri, 13 Mar 2020 14:19:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=99=BB=E5=85=A5=E4=B8=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0device=5Fnumber=20=20=20=E4=B8=94=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=B8=8D=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Model/UserModel.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Application/Admin/Model/UserModel.class.php b/Application/Admin/Model/UserModel.class.php index a3a7bbf6..ba7bc8f1 100644 --- a/Application/Admin/Model/UserModel.class.php +++ b/Application/Admin/Model/UserModel.class.php @@ -402,7 +402,7 @@ class UserModel extends Model{ 'sdk_version'=>$sdk_version, 'check_time' => time(), 'device_type'=>$device_type, - 'device_number' =>$unique_code + 'device_number' =>$unique_code ? $unique_code : '' ); if($register_type==2){ $map['phone']=$phone; @@ -425,7 +425,7 @@ class UserModel extends Model{ $uid = $this->add(); /* // 找该设备绑定的上级推广员 优先找这个表的 - if ($unique_code) { + if ($unique_code && $promote_id >0) { M('device_promote', 'tab_')->add(array( 'user_id' => $uid, 'promote_id' => $promote_id, @@ -1024,7 +1024,7 @@ class UserModel extends Model{ 'openid' =>$userinfo['openid'], 'check_time' => time(), 'device_type' => $userinfo['device_type'], - 'device_number' => $userinfo['unique_code'] + 'device_number' => $userinfo['unique_code'] ? $userinfo['unique_code'] : '' ); /* 添加用户 */ if($this->create($data)){ @@ -1118,9 +1118,9 @@ class UserModel extends Model{ $data["id"] = $uid; $data["login_time"] = NOW_TIME; $data["login_ip"] = get_client_ip(); - $data["device_number"] = $unique_code; +// $data["device_number"] = $unique_code; $data["last_login_ip"] = $user['login_ip']; - $data["last_device_number"] = $user['device_number']; + $data["last_device_number"] = $user['device_number'] ? $user['device_number'] : ''; $data["token"] = $this->generateToken($uid,$account,$password); M('user_token','tab_')->startTrans(); @@ -1222,7 +1222,7 @@ class UserModel extends Model{ $model = M('User','tab_'); $uid = $user['id']; $data["id"] = $uid; - $data["device_number"] = $unique_code; + $data["device_number"] = $unique_code ? $unique_code : ''; $data["last_device_number"] = $user['device_number']; $data["lock_status"] = 0 ; $model->save($data);