field('id,hotel_name as name'); $where = ["del_flag"=>0,"group_id"=>$params['group_id']]; if($keyValue){ $where = ['id'=>$keyValue,"del_flag"=>0,"group_id"=>$params['group_id']]; }elseif($name){ $where = ['hotel_name'=>['like','%'.$name.'%'],"del_flag"=>0,"group_id"=>$params['group_id']]; } return $this->where($where)->select()->toArray(); } }