|
|
@ -2248,18 +2248,19 @@ class UserController extends BaseController
|
|
|
|
'promote_id' => $request['promote_id'],
|
|
|
|
'promote_id' => $request['promote_id'],
|
|
|
|
'lpuid' => $user['puid'],
|
|
|
|
'lpuid' => $user['puid'],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
$return = M('UserLoginRecord', 'tab_') -> add($da);
|
|
|
|
// $return = M('UserLoginRecord', 'tab_') -> add($da);
|
|
|
|
if ($return) {
|
|
|
|
$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) {
|
|
|
|
if ($request['state'] == 1) {
|
|
|
|
M('nearby', 'tab_') -> where(['user_id' => $user['id']]) -> setField(['update_time' => time(), 'game_status' => 0]);
|
|
|
|
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' => '数据新增成功!')));
|
|
|
|
echo base64_encode(json_encode(array('status' => 200, 'return_msg' => '数据新增成功!')));
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
|
|
|
|
$this -> set_message(0, "fail", "数据新增失败!");
|
|
|
|
// $this -> set_message(0, "fail", "数据新增失败!");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|