$model = new Article_list();
$res = $request->only(['label_id','brand_id','course_id','phone']);
if (!empty($res)){
if ($res['phone']){
$model = $model->where('phone','like','%'.$res['phone'].'%');
}
if ($res['label_id']){
$model = $model->where('label_id','=',$res['label_id']);
}if ($res['brand_id']){
$model = $model->where('brand_id','=',$res['brand_id']);
}
if ($res['course_id']){
$model = $model->where('course_id','=',$res['course_id']);
}
}
$count=$model->count();//总数目
$Category= $this->tree();
$data=$this->page($page,$count);
$data['pagesize']='20';
$users=$model->offset(($data['currentPage']-1)*$data['pagesize'])->limit($data['pagesize'])->orderBy('article_id','DESC')->get();