model = new \app\api\model\WxArticleView; } /** * 列表 */ public function index(){ $this->request->filter('trim,strip_tags,xss_clean'); list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $list = $this->model->with(['wxcategory'])->where($where)->order($sort, $order)->paginate($limit); foreach ($list as $row) { $row->visible(['id','user_id','wx_article_id','wx_category_id','createtime']); $row->visible(['wxcategory']); $row->getRelation('wxcategory')->visible(['name']); } $list = $this->__handle_index__($list); return $this->success('数据列表',$list); } }