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", "数据新增失败!"); + + } }