|
@@ -8,17 +8,20 @@ class MessageController extends AdminBaseController{
|
|
|
public function index(){
|
|
public function index(){
|
|
|
//分类信息
|
|
//分类信息
|
|
|
$param = $this->request->param();
|
|
$param = $this->request->param();
|
|
|
- //分类信息
|
|
|
|
|
- $cate_tree=$this->getAccessTreeData();
|
|
|
|
|
- $this->assign('cate_tree',json_encode($cate_tree));
|
|
|
|
|
|
|
+
|
|
|
isset($param['cate_id']) or $param['cate_id']=0;
|
|
isset($param['cate_id']) or $param['cate_id']=0;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
$this->assign('cate_id',$param['cate_id']);
|
|
$this->assign('cate_id',$param['cate_id']);
|
|
|
$username = $_SESSION['think']['name'];
|
|
$username = $_SESSION['think']['name'];
|
|
|
$userinfo = Db::name('user')->where('user_login',$username)->find();
|
|
$userinfo = Db::name('user')->where('user_login',$username)->find();
|
|
|
$catid = isset($param['catid'])?$param['catid']:0;
|
|
$catid = isset($param['catid'])?$param['catid']:0;
|
|
|
$this->assign("catid",$catid);
|
|
$this->assign("catid",$catid);
|
|
|
if($userinfo['user_type']== 1){
|
|
if($userinfo['user_type']== 1){
|
|
|
|
|
+
|
|
|
|
|
+ //分类信息
|
|
|
|
|
+ $cate_tree=$this->getAccessTreeData();
|
|
|
|
|
+ $this->assign('cate_tree',json_encode($cate_tree));
|
|
|
|
|
+
|
|
|
$map = array();
|
|
$map = array();
|
|
|
$query = array();
|
|
$query = array();
|
|
|
if($catid){
|
|
if($catid){
|
|
@@ -32,11 +35,11 @@ class MessageController extends AdminBaseController{
|
|
|
$cate_arr[] = $vv['id'];
|
|
$cate_arr[] = $vv['id'];
|
|
|
}
|
|
}
|
|
|
$map[] = ['catid','in',$cate_arr];
|
|
$map[] = ['catid','in',$cate_arr];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}else{
|
|
}else{
|
|
|
- $map['catid'] = $catid;
|
|
|
|
|
|
|
+ $map['catid'] = $catid;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
$this->assign('qx',1);
|
|
$this->assign('qx',1);
|
|
|
$users = Db::name('user')->where('id','gt',1)->select();
|
|
$users = Db::name('user')->where('id','gt',1)->select();
|
|
@@ -44,13 +47,14 @@ class MessageController extends AdminBaseController{
|
|
|
//超级管理员
|
|
//超级管理员
|
|
|
$lists = Db::name('message')->where($map)->order('id desc')->paginate(20,false,['query'=>$query]);
|
|
$lists = Db::name('message')->where($map)->order('id desc')->paginate(20,false,['query'=>$query]);
|
|
|
$this->assign('lists',$lists);
|
|
$this->assign('lists',$lists);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
}else{
|
|
}else{
|
|
|
$map = array();
|
|
$map = array();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if($catid){
|
|
if($catid){
|
|
|
$map['catid'] = $catid;
|
|
$map['catid'] = $catid;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
//普通用户
|
|
//普通用户
|
|
|
$this->assign('qx',0);
|
|
$this->assign('qx',0);
|
|
@@ -76,29 +80,30 @@ class MessageController extends AdminBaseController{
|
|
|
->leftJoin('mobile_log p2','p1.`id`=p2.`msg_id`')
|
|
->leftJoin('mobile_log p2','p1.`id`=p2.`msg_id`')
|
|
|
->group('p1.`id`')
|
|
->group('p1.`id`')
|
|
|
->field($field)->where('p1.catid','in',$cates)->where($map2)->limit(0,$from)->select();
|
|
->field($field)->where('p1.catid','in',$cates)->where($map2)->limit(0,$from)->select();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}else{
|
|
}else{
|
|
|
|
|
|
|
|
$field=['*'];
|
|
$field=['*'];
|
|
|
$lists = Db::name('message')->field($field)->where('catid','in',$cates)->where($map)->order('id')->limit(0,$from)->select();
|
|
$lists = Db::name('message')->field($field)->where('catid','in',$cates)->where($map)->order('id')->limit(0,$from)->select();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// $lists = Db::name('message')->field($field)->where('catid','in',$cates)->where($map)->order('id')->limit(0,$from)->select();
|
|
// $lists = Db::name('message')->field($field)->where('catid','in',$cates)->where($map)->order('id')->limit(0,$from)->select();
|
|
|
- $this->assign('fenpei',$fenpei);
|
|
|
|
|
|
|
+
|
|
|
//ppppp
|
|
//ppppp
|
|
|
// if($from<20){
|
|
// if($from<20){
|
|
|
// $lists = Db::name('message')->where('catid','in',$cates)->where($map)->order('id desc')->limit(0,$from)->select();
|
|
// $lists = Db::name('message')->where('catid','in',$cates)->where($map)->order('id desc')->limit(0,$from)->select();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// }else{
|
|
// }else{
|
|
|
// $curinfo = Db::name('message')->where('catid','in',$cates)->where($map)->order('id desc')->limit($from,1)->find();
|
|
// $curinfo = Db::name('message')->where('catid','in',$cates)->where($map)->order('id desc')->limit($from,1)->find();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// $curid = $curinfo['id'];
|
|
// $curid = $curinfo['id'];
|
|
|
- // $lists = Db::name('message')->where('catid','in',$cates)->where($map)->where('id','>',$curid)->order('id desc')->select;
|
|
|
|
|
|
|
+ // $lists = Db::name('message')->where('catid','in',$cates)->where($map)->where('id','>',$curid)->order('id desc')->select;
|
|
|
// }
|
|
// }
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+ $this->assign('fenpei',$fenpei);
|
|
|
$this->assign('lists',$lists);
|
|
$this->assign('lists',$lists);
|
|
|
}
|
|
}
|
|
|
return $this->fetch();
|
|
return $this->fetch();
|