From 68d6b39b5de5cc049cc75e1398d36be5dac4f0d3 Mon Sep 17 00:00:00 2001 From: tping Date: Tue, 10 Mar 2020 15:37:19 +0800 Subject: [PATCH 1/3] =?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/3] =?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/3] =?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", "数据新增失败!"); + + } }