优化权限

master
chenzhi 4 years ago
parent 3fdc14120f
commit b7cc3ccd77

@ -118,6 +118,7 @@ return array(
'SUBSITE_TABLE'=>[ 'SUBSITE_TABLE'=>[
"tab_spend", "tab_spend",
"sys_auth_group", "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); session('ADMIN_MENU_LIST.'.$controller,$menus);
} }
return $menus; return $menus;
} }

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

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

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

Loading…
Cancel
Save