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