belongsToMany('PortalPostModel','portal_category_post','post_id','category_id')->alias('a')->order('a.id','desc')->field('a.id,a.post_title,post_excerpt,update_time'); } public function getlist($id=1) { $list = $this::get($id,['portal'=>function($query){$query->where(['delete_time'=>0,'post_status'=>1]);}]); return $list->portal; } }