登录信息

master
zhanglingsheng 5 years ago
parent 8ef20e5c8e
commit ff395e1af2

@ -2248,18 +2248,19 @@ class UserController extends BaseController
'promote_id' => $request['promote_id'],
'lpuid' => $user['puid'],
);
$return = M('UserLoginRecord', 'tab_') -> add($da);
if ($return) {
// $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) {
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 {
// } else {
$this -> set_message(0, "fail", "数据新增失败!");
// $this -> set_message(0, "fail", "数据新增失败!");
}
// }
}

Loading…
Cancel
Save