/** * Manages all models. */ public function actionIndex() { $model = new DoctorElements('search'); $model->attachBehavior('dateComparator', array('class' => 'DateComparator')); $model->unsetAttributes(); // clear any default values // set attributes from get if (isset($_GET['DoctorElements'])) { $model->attributes = $_GET['DoctorElements']; } $param = null; if (!empty($_GET['doctor_rubrics_id']) && (int) $_GET['doctor_rubrics_id'] > 0) { $arr = array(); foreach (DoctorSpecialization::model()->findAll('doctor_rubrics_id = ' . (int) $_GET['doctor_rubrics_id']) as $data) { $arr[] = $data->doctor_elements_id; } $param = ' id in (' . implode(",", $arr) . ') '; } $this->render('list', array('model' => $model, 'param' => $param)); }