优化权限

master
chenzhi 4 years ago
parent 3fdc14120f
commit b7cc3ccd77

@ -118,6 +118,7 @@ return array(
'SUBSITE_TABLE'=>[
"tab_spend",
"sys_auth_group",
"tab_index_chart"
"tab_index_chart",
"tab_deposit"
]
);

@ -406,6 +406,7 @@ class AdminController extends Controller {
}
session('ADMIN_MENU_LIST.'.$controller,$menus);
}
return $menus;
}

@ -36,6 +36,11 @@ class DepositModel extends Model {
public function __construct($name = '', $tablePrefix = '', $connection = '') {
/* 设置默认的表前缀 */
$this->tablePrefix ='tab_';
if(is_subsiteTable("tab_spend")){
//修改连接
$this->connection = SUBSITE_DB;
$connection = SUBSITE_DB;
}
/* 执行构造方法 */
parent::__construct($name, $tablePrefix, $connection);
}

@ -28,10 +28,12 @@
</style>
<div class="cf main-place top_nav_list navtab_list">
<if condition="!IS_SUBSITE">
<div class="fr">
<a class="tabchose" href="{:U('lists',array('type'=>1))}">平台币充值</a>
<a href="{:U('lists_secord',array('type'=>2))}">推广员充值</a>
</div>
</if>
<h3 class="page_title">平台币充值</h3>
<p class="description_text">说明:玩家充值平台币到账户的记录,不包含消费平台币的记录,如需查询平台币使用,请到游戏充值中查询</p>
</div>
@ -212,7 +214,7 @@
</td>
<td style="text-indent:0;">
<if condition="$data['pay_status'] eq 0">
<if condition="$data['pay_status'] eq 0 && !IS_SUBSITE">
<a class="pay_repair" href="javascript:void(0);"
href-data="{$data.pay_order_number}" href-hhh="{:U('Repair/noticePayed')}" style="width:100%;">通知到账</a>
</if>

@ -148,11 +148,12 @@ class Auth{
static $groups = array();
if (isset($groups[$uid]))
return $groups[$uid];
$user_groups = M()
->table($this->_config['AUTH_GROUP_ACCESS'] . ' a')
->where("a.uid='$uid' and g.status='1'")
->join($this->_config['AUTH_GROUP']." g on a.group_id=g.id")
->field('uid,group_id,title,rules')->select();
$user_base = M()->table($this->_config['AUTH_GROUP_ACCESS'])->where("uid = {$uid}")->field('uid,group_id')->find();
$user_rule= SM("auth_group","sys_")->where("id = {$user_base['group_id']} and status = 1")->field('title,rules')->find();
if(empty($user_base) || empty($user_rule)){
return [];
}
$user_groups = [array_merge($user_base,$user_rule)];
$groups[$uid]=$user_groups?:array();
return $groups[$uid];
}

Loading…
Cancel
Save