导出添加数据权限

master
liuweiwen 5 years ago
parent 31790a7e51
commit 4bf6352f9d

@ -243,6 +243,8 @@ class ExportController extends Controller
unset($_REQUEST['start']); unset($_REQUEST['start']);
unset($_REQUEST['end']); unset($_REQUEST['end']);
} }
//为数据权限添加
setPowerPromoteIds($map);
$model = array( $model = array(
'm_name' => 'User', 'm_name' => 'User',
'join' => 'tab_promote ON tab_user.promote_id = tab_promote.id', 'join' => 'tab_promote ON tab_user.promote_id = tab_promote.id',
@ -983,6 +985,8 @@ class ExportController extends Controller
unset($_REQUEST['game_name']); unset($_REQUEST['game_name']);
} }
} }
//为数据权限添加
setPowerPromoteIds($map);
$map1 = $map; $map1 = $map;
$map1['pay_status'] = 1; $map1['pay_status'] = 1;
$total = M('Agent', 'tab_')->where($map1)->sum('amount'); $total = M('Agent', 'tab_')->where($map1)->sum('amount');
@ -1508,7 +1512,8 @@ class ExportController extends Controller
$map['promote_account'] = $_REQUEST['promote_account']; $map['promote_account'] = $_REQUEST['promote_account'];
} }
} }
//为数据权限添加
setPowerPromoteIds($map);
if ($_REQUEST['create_time'] == 2) { if ($_REQUEST['create_time'] == 2) {
$order = 'create_time desc'; $order = 'create_time desc';
} elseif ($_REQUEST['create_time'] == 1) { } elseif ($_REQUEST['create_time'] == 1) {
@ -1586,7 +1591,8 @@ class ExportController extends Controller
unset($_REQUEST['game_name']); unset($_REQUEST['game_name']);
} }
} }
//为数据权限添加
setPowerPromoteIds($map);
$xlsData = M('settlement', 'tab_') $xlsData = M('settlement', 'tab_')
->field(array( ->field(array(
'settlement_number', 'settlement_number',
@ -5390,7 +5396,8 @@ if ($key == 'model'){
//为数据权限添加
setPowerPromoteIds($map, 'id');
$xlsData = []; $xlsData = [];
// if(is_array($data)){ // if(is_array($data)){
@ -5590,7 +5597,8 @@ if ($key == 'model'){
$row = $_REQUEST['row']?$_REQUEST['row']:10; $row = $_REQUEST['row']?$_REQUEST['row']:10;
//为数据权限添加
setPowerPromoteIds($map);
$data=$model $data=$model
->field('tab_apply.*,tab_game.ratio as game_ratio,tab_game.money as game_money') ->field('tab_apply.*,tab_game.ratio as game_ratio,tab_game.money as game_money')
->join('LEFT JOIN tab_game ON tab_apply.game_id = tab_game.id') ->join('LEFT JOIN tab_game ON tab_apply.game_id = tab_game.id')
@ -5770,7 +5778,8 @@ if ($key == 'model'){
$fp = fopen('php://output', 'a');//打开output流 $fp = fopen('php://output', 'a');//打开output流
mb_convert_variables('GBK', 'UTF-8', $xlsCell); mb_convert_variables('GBK', 'UTF-8', $xlsCell);
fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中 fputcsv($fp, $xlsCell);//将数据格式化为CSV格式并写入到output流中
//为数据权限添加
setPowerPromoteIds($map);
$accessNum=$model $accessNum=$model
->join("left join tab_promote on tab_promote.id=tab_user.promote_id") ->join("left join tab_promote on tab_promote.id=tab_user.promote_id")
->field("tab_user.id,tab_user.account,tab_user.register_time,tab_user.login_time,tab_user.register_type ->field("tab_user.id,tab_user.account,tab_user.register_time,tab_user.login_time,tab_user.register_type
@ -5943,7 +5952,7 @@ if ($key == 'model'){
); );
$map['type'] = 2; $map['type'] = 2;
$map['source_id'] = ['neq',0]; $map['source_id'] = ['neq',0];
if(isset($_REQUEST['source_id'])) {$map['source_id'] = $_REQUEST['source_id'];} if(isset($_REQUEST['source_id'])) {$map['source_id'] = $_REQUEST['source_id'];}
if(isset($_REQUEST['promote_id'])) {$map['promote_id'] = $_REQUEST['promote_id'];} if(isset($_REQUEST['promote_id'])) {$map['promote_id'] = $_REQUEST['promote_id'];}
@ -5953,10 +5962,10 @@ if ($key == 'model'){
$page = $page?$page:1; $page = $page?$page:1;
$row = $_REQUEST['row']?$_REQUEST['row']:10; $row = $_REQUEST['row']?$_REQUEST['row']:10;
//为数据权限添加
setPowerPromoteIds($map);
$data = $model->where($map)
$data=$model
->where($map)
->order('id desc') ->order('id desc')
->select(); ->select();
@ -6322,6 +6331,9 @@ if ($key == 'model'){
$map['tab_spend.promote_id'] = $map['promote_id']; $map['tab_spend.promote_id'] = $map['promote_id'];
unset($map['promote_id']); unset($map['promote_id']);
//为数据权限添加
setPowerPromoteIds($map);
$csvFileName = $xlsName . '.csv'; $csvFileName = $xlsName . '.csv';
//设置好告诉浏览器要下载excel文件的headers //设置好告诉浏览器要下载excel文件的headers
header('Content-Description: File Transfer'); header('Content-Description: File Transfer');

@ -165,7 +165,7 @@ background-color: #FF9797;
</div> </div>
</div> </div>
<div class="page"> <div class="page">
<a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>2,'xlsname'=>'数据管理_实时注册'),I('get.')))}">导出</a> <a class="sch-btn" href="{:U('Export/expUser',array_merge(array('id'=>2,'xlsname'=>'数据管理_实时注册'),I('get.')))}">导出</a>
{$_page|default=''} {$_page|default=''}
</div> </div>

Loading…
Cancel
Save