|
|
@ -32,6 +32,7 @@ function is_login()
|
|
|
|
if (time() - intval(session('user_auth_expire')) > $expire) { // 过期正则直接去除掉session 并且返回false
|
|
|
|
if (time() - intval(session('user_auth_expire')) > $expire) { // 过期正则直接去除掉session 并且返回false
|
|
|
|
session('user_auth', null);
|
|
|
|
session('user_auth', null);
|
|
|
|
session('user_auth_sign', null);
|
|
|
|
session('user_auth_sign', null);
|
|
|
|
|
|
|
|
session('user_group_id', null);
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
session('user_auth_expire', time() + $expire);
|
|
|
|
session('user_auth_expire', time() + $expire);
|
|
|
@ -48,7 +49,9 @@ function is_login()
|
|
|
|
function is_administrator($uid = null)
|
|
|
|
function is_administrator($uid = null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$uid = is_null($uid) ? is_login() : $uid;
|
|
|
|
$uid = is_null($uid) ? is_login() : $uid;
|
|
|
|
return $uid && (intval($uid) === C('USER_ADMINISTRATOR'));
|
|
|
|
|
|
|
|
|
|
|
|
return $uid && (session('user_group_id') == 1);
|
|
|
|
|
|
|
|
// (intval($uid) === C('USER_ADMINISTRATOR'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1472,4 +1475,12 @@ function getPromoteCompanyName($companyId)
|
|
|
|
function getGameTypes()
|
|
|
|
function getGameTypes()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return M('game_type', 'tab_')->field('id, type_name')->where(['status' => 1])->select();
|
|
|
|
return M('game_type', 'tab_')->field('id, type_name')->where(['status' => 1])->select();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getGameGroup($uid) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$groupId = M('auth_group_access')->field('group_id')->where(['uid'=>$uid])->find();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $groupId['group_id']?$groupId['group_id']:0;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|