未成年临时处理

master
tping 3 years ago
parent 0d0024609e
commit 57bd348b9a

@ -455,4 +455,17 @@ function get_discount($gameId, $userId)
];
}
return $res;
}
// 未成年强制下线处理
function forceOffline($userId) {
$user = M('user', 'tab_')->where(['id' => $userId])->find();
if ($user['age_status'] == 3) {
echo base64_encode (json_encode(array(
"code" => 9999,
"msg" => "您已下线,请重新登入",
"data" => ""
)));
exit ();
}
}

@ -30,6 +30,10 @@ class UserController extends BaseController
$userService = new UserService();
$result = $userService->loginSdk($params);
if ($result['status']) {
$user = M('user', 'tab_')->where(['id' => $result['user_id']])->find();
if ($user['age_status'] == 3) {
$this->set_message(1001, "fail", "未成年禁止登入,请稍后再试!");
}
echo base64_encode(json_encode($result['data']));
} else {
$this->set_message(1001, "fail", $result['message']);
@ -1439,6 +1443,8 @@ class UserController extends BaseController
$this->set_message(1001, "fail", "操作数据不能为空");
}
forceOffline($request['user_id']);
$params = [
'user_id' => $request['user_id'],
'game_id' => $request['game_id'],
@ -2524,6 +2530,9 @@ class UserController extends BaseController
$log['remarks'] = '修改成功';
log_action($log);
$data['status'] = 200;
forceOffline($user['user_id']);
echo base64_encode(json_encode($data));
}

Loading…
Cancel
Save