tp5 分页权限权限设置显示

    $adminid = cookie("adminid");
$shop_id=$this->get_shop_id();
if($adminid==1){
$uid = input("uid");
$shop=db('shop')->where('status',2)->select();
$this->assign('shop', $shop);
if($uid){
$lists = db('balance_log')
->alias('a')
->join('shop s','a.uid = s.uid')
->where('a.uid',$uid)
->where($maps)
->paginate(15, false, ['query' => ['uid' => $uid]]);//因为权限不一样所以需要传下uid
}else{
$lists = db('balance_log')
->where($maps)
->paginate(15);
}

// var_dump($lists);
$num=db('balance_log') ->where($maps)->count();

}else{

$map['id'] = $shop_id;

$shop_name = db('shop')->where($map)->field('id,uid,shop_name')->find();

$lists = db('balance_log')
->where('uid',$shop_name['uid'])
->where($maps)
->order('createtime desc')
->paginate(15);

$num=db('balance_log')->count();

}

资料查看 转至 https://blog.csdn.net/h330531987/article/details/78319595

posted @ 2019-05-10 09:52  zlf2000  阅读(312)  评论(0编辑  收藏  举报