数据权限bug修正

master
zhengyongxing 5 years ago
parent 3151e8b456
commit ce0e9f943d

@ -1625,10 +1625,12 @@ function setPowerPromoteIds(&$map, $column = 'promote_id') {
function get_promote_listOther($select='') { function get_promote_listOther($select='') {
$promoteRoot = getPowerPromoteIds(); // $promoteRoot = getPowerPromoteIds();
if ($promoteRoot) { // if ($promoteRoot) {
$map['id'] =array('in',$promoteRoot); // $map['id'] =array('in',$promoteRoot);
} // }
setPowerPromoteIds($map,'id');
$list = M("Promote","tab_")->field('id,account,balance_coin')->where($map)->select();//where("status=1")-> $list = M("Promote","tab_")->field('id,account,balance_coin')->where($map)->select();//where("status=1")->
if (empty($list)){return '';} if (empty($list)){return '';}
@ -1652,10 +1654,12 @@ function promote_listsOther($type){
$map = ''; $map = '';
} }
$promoteRoot = getPowerPromoteIds(); // $promoteRoot = getPowerPromoteIds();
if ($promoteRoot) { // if ($promoteRoot) {
$map['id'] =array('in',$promoteRoot); // $map['id'] =array('in',$promoteRoot);
} // }
setPowerPromoteIds($map,'id');
$data = M('promote','tab_')->where($map)->select(); $data = M('promote','tab_')->where($map)->select();

@ -388,9 +388,11 @@ class PromoteModel extends Model{
public function getPromotersByLevelOther($level=1) public function getPromotersByLevelOther($level=1)
{ {
$result = [];
$promoteRoot = getPowerPromoteIds(); $where['level'] = $level;
$result = $this->field("*")->where("level={$level} and id IN({$promoteRoot})")->select(); setPowerPromoteIds($where,'id');
$result = $this->field("*")->where($where)->select();
foreach ($result as &$item) { foreach ($result as &$item) {
$item['nickname'] = $item['account'] . ($item['nickname'] ? "({$item['nickname']})" : ""); $item['nickname'] = $item['account'] . ($item['nickname'] ? "({$item['nickname']})" : "");
} }

Loading…
Cancel
Save