field('project_id')->where(['id'=>$this->aid])->find(); if($this->aid != 1){ $where = [ 'id'=>['in',$user_data['project_id']], ]; }else{ $where = []; } $data=$model->where($where)->select(); $this->assign('data',$data); return $this->fetch('index'); } }