diff --git a/Application/Admin/Common/extend.php b/Application/Admin/Common/extend.php index c13ccf1a2..855a8d713 100644 --- a/Application/Admin/Common/extend.php +++ b/Application/Admin/Common/extend.php @@ -1608,7 +1608,7 @@ function setPowerPromoteIds(&$map, $column = 'promote_id') { //为数据权限添加 $promoteIds = getPowerPromoteIds(); if (empty($promoteIds)) { - $map[$column] = 0; + $map[$column] = -1; } elseif ($promoteIds != 'all') { $map[$column] = array('in', $promoteIds); } diff --git a/Application/Admin/Controller/MendController.class.php b/Application/Admin/Controller/MendController.class.php index 57a03734f..2029d2939 100644 --- a/Application/Admin/Controller/MendController.class.php +++ b/Application/Admin/Controller/MendController.class.php @@ -29,6 +29,8 @@ class MendController extends ThinkController { $map['register_time'] = array('gt', 0); $p = I('p'); $map['register_type'] = array('in','(0,1,2,3,4,5,6,7)'); + //为数据权限添加 + setPowerPromoteIds($map); parent::lists("user",$p,$map); } /** @@ -58,7 +60,8 @@ class MendController extends ThinkController { } elseif (isset($_REQUEST['time_end'])) { $map['order_time'] = ['LT', strtotime($_REQUEST['time_end']) + 86399]; } - + //为数据权限添加 + setPowerPromoteIds($map); $data = M("Mend","tab_") ->field("user_account,promote_account,pay_amount,promote_account_to,order_time,create_time,op_account,remark") ->where($map) diff --git a/Application/Admin/Controller/PromoteCoinController.class.php b/Application/Admin/Controller/PromoteCoinController.class.php index a45cb9087..5eefe4d0e 100644 --- a/Application/Admin/Controller/PromoteCoinController.class.php +++ b/Application/Admin/Controller/PromoteCoinController.class.php @@ -179,7 +179,8 @@ class PromoteCoinController extends ThinkController if (!empty($_REQUEST['grand_id'])) $source_ids[] = $_REQUEST['grand_id']; if (!empty($_REQUEST['child_id'])) $source_ids[] = $_REQUEST['child_id']; if (!empty($source_ids)) $extend['source_id'] = ['in', $source_ids]; - + //为数据权限添加 + setPowerPromoteIds($extend); $map = $extend; $map['create_time'] = total(1, false); $sum['to_day'] = D(self::model_name)->where($map)->sum('num'); diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index 66c38481f..1f7ac555d 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -133,7 +133,10 @@ class PromoteController extends ThinkController } } } + // dump($map);die(); + //为数据权限添加 + setPowerPromoteIds($map, 'id'); $list_data = D(self::model_name)->where($map)->order('id DESC')->page($p, $row)->select(); $oa_data = []; @@ -190,7 +193,8 @@ class PromoteController extends ThinkController $this->m_title = '混服申请'; $this->assign('commonset', M('Kuaijieicon')->where(['url'=>'Promote/lists/type/2','status'=>1])->find()); - + //为数据权限添加 + setPowerPromoteIds($map); parent::lists('SiteApply', $p, $map); } @@ -509,6 +513,8 @@ class PromoteController extends ThinkController unset($_REQUEST['end']); } $map['puid'] = 0; + //为数据权限添加 + setPowerPromoteIds($map); $model = array( 'm_name' => 'User', 'join' => 'tab_promote ON tab_user.promote_id = tab_promote.id', @@ -655,6 +661,8 @@ class PromoteController extends ThinkController $map['promote_id']=array($map['promote_id'],array('in',implode(',', $all_promote_id)),'and'); } + //为数据权限添加 + setPowerPromoteIds($map); $model = array( 'm_name' => 'Spend', 'map' => $map, @@ -733,6 +741,9 @@ class PromoteController extends ThinkController } empty(I('promote_id')) || $map['promote_id'] = I('promote_id'); $map['pay_status'] = 1; + + //为数据权限添加 + setPowerPromoteIds($map); $map1=$map; $map1['pay_status']=1; $total=D('Agent')->field('sum(amount) amount,sum(real_amount) real_amount')->where($map1)->find(); diff --git a/Application/Admin/Controller/QueryController.class.php b/Application/Admin/Controller/QueryController.class.php index 8293239b0..6626aa17e 100644 --- a/Application/Admin/Controller/QueryController.class.php +++ b/Application/Admin/Controller/QueryController.class.php @@ -90,6 +90,8 @@ class QueryController extends ThinkController $map['smap'] = $smap; $user = A('Settlement', 'Event'); + //为数据权限添加 + setPowerPromoteIds($map); $user->settlement($model, $p, $map); } else { $this->display(); @@ -147,6 +149,8 @@ class QueryController extends ThinkController 'title' => '结算账单', 'template_list' => 'settlement', ); + //为数据权限添加 + setPowerPromoteIds($map1); $map1 = $map; $ztotal = null_to_0(D('settlement')->where($map1)->sum('sum_money*10000') / 10000); $this->assign('ztotal', $ztotal); @@ -683,6 +687,9 @@ class QueryController extends ThinkController 'template_list' => 'withdraw', ); $map1 = array('status' => ['neq', -1]); + //为数据权限添加 + setPowerPromoteIds($map1); + $total = null_to_0(D('withdraw')->where($map1)->sum('sum_money')); $ttotal = null_to_0(D('withdraw')->where('create_time' . total(1))->where($map1)->sum('sum_money')); $ytotal = null_to_0(D('withdraw')->where('create_time' . total(5))->where($map1)->sum('sum_money')); @@ -694,7 +701,8 @@ class QueryController extends ThinkController $this->m_title = '推广提现'; $this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Query/withdraw', 'status' => 1])->find()); - + //为数据权限添加 + setPowerPromoteIds($map); $user->money_list($model, $p, $map); }