From cba6dde69fd20f5e15dceaccdd80d0f397201f4a Mon Sep 17 00:00:00 2001 From: tping Date: Tue, 10 Mar 2020 17:09:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8B=E7=BA=BF=E6=97=B6?= =?UTF-8?q?=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", "数据新增失败!"); + + } }