数据权限提交

master
zhengyongxing 5 years ago
parent a877b475f5
commit d465be8969

@ -1610,6 +1610,11 @@ function getPowerPromoteIds()
}
}
}
// var_dump(in_array('-1',explode(',',$userAuth['data_president'])));die();
if (in_array('-1',explode(',',$userAuth['data_president']))) {
$promoteIds = $promoteIds .',0';
}
// var_dump($promoteIds);die();
session('user_auth_promote_ids', $promoteIds);
return $promoteIds;
}

@ -482,7 +482,7 @@ class AuthManagerController extends AdminController{
if ($AuthGroup->where("id = {$gid}")->save(array('data_empower_type'=>$data_empower_type,'data_president'=>$promoteData))) {
$this->success('操作成功',U('AuthManager/index'));
} else {
$this->error('操作失败');
$this->error('操作失败,请改变成员');
}
}
@ -491,6 +491,8 @@ class AuthManagerController extends AdminController{
$promoteData = M('promote','tab_')->field('id as value,account as title')->where(array('level'=>1,'chain'=>'/'))->select();
$data_president = M('AuthGroup')->field('data_president')->where(array('id'=>$_REQUEST['group_id']))->find();
$promoteData = array_merge([0=>['value'=>'-1','title'=>'官方渠道']],$promoteData);
$returnData = array('data_president'=>$data_president['data_president'],'list'=>$promoteData);
$this->ajaxReturn(json_encode($returnData));

@ -88,6 +88,7 @@ class MemberController extends ThinkController
$game_map = " and tab_user_play_info.server_name = '{$_REQUEST['server_name']}' ";
}
$promoteRoot = getPowerPromoteIds();
// $data_empower_type = session('user_auth')['data_empower_type'];
//// var_dump($promoteRoot);die();
//

@ -392,10 +392,18 @@ class PromoteModel extends Model{
$where['level'] = $level;
setPowerPromoteIds($where,'id');
$offcialData = [0=>['id'=>0,'nickname'=>'官方渠道']];
$result = $this->field("*")->where($where)->select();
foreach ($result as &$item) {
$item['nickname'] = $item['account'] . ($item['nickname'] ? "({$item['nickname']})" : "");
}
if (in_array('0',explode(',',$where['id'][1]))) {
$result = array_merge($offcialData,$result);
// dump($result);die();
}
return $result;
}
}

@ -120,6 +120,8 @@
if (JSON.parse(data1).data_president) {
var data2 = JSON.parse(data1).data_president.split(",");
}
// var dataTransfers = transfer.getData('key123');
// $('#promote_data').val(JSON.stringify(dataTransfers));
//显示搜索框
transfer.render({
elem: '#test4'
@ -134,6 +136,9 @@
$('#promote_data').val(JSON.stringify(dataTransfer));
}
})
var dataTransfers = transfer.getData('key123');
$('#promote_data').val(JSON.stringify(dataTransfers));
transfets = transfer;
//批量办法定事件
util.event('lay-demoTransferActive', {

@ -417,7 +417,9 @@
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>';
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"

@ -306,7 +306,9 @@
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>';
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"

@ -456,7 +456,10 @@ $(function(){
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option><option value="UC"'+(promote_id && 'UC' == promote_id?'selected':'')+'>UC渠道</option>';
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
// '<option value="UC"'+(promote_id && 'UC' == promote_id?'selected':'')+'>UC渠道</option>' +
'';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';

@ -300,7 +300,9 @@ $(function(){
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>';
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';

@ -491,7 +491,9 @@
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>';
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
'';
data = response.data;
for (var i in data){
str += "<option value='"+data[i].id+"' "+(promote_id && data[i].id == promote_id?'selected':'')+">"+data[i].nickname+"</option>"

@ -303,7 +303,10 @@ $(".select_gallery").select2();
data:{level:$("#promote_level option:selected").val()},
dataType:'json',
success:function(response){
str = '<option value="">请选择推广员</option><option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option><option value="UC"'+(promote_id && 'UC' == promote_id?'selected':'')+'>UC渠道</option>';
str = '<option value="">请选择推广员</option>' +
// '<option value="0"'+(promote_id && 0 == promote_id?'selected':'')+'>官方渠道</option>' +
// '<option value="UC"'+(promote_id && 'UC' == promote_id?'selected':'')+'>UC渠道</option>' +
'';
// $.each(response.data, function(index, item){
// console.log(item.id);
// str += '<option value="'+item.id+' '+(promote_id && item.id == promote_id?'selected':'')+'">'+item.nickname+'</option>';

Loading…
Cancel
Save