public function search($params) { $query = Specialist::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id]); $query->andFilterWhere(['like', 'intro', $this->intro])->andFilterWhere(['like', 'first_name', $this->first_name])->andFilterWhere(['like', 'last_name', $this->last_name])->andFilterWhere(['like', 'middle_name', $this->middle_name])->andFilterWhere(['like', 'photo_image', $this->photo_image])->andFilterWhere(['like', 'phone', $this->phone])->andFilterWhere(['like', 'email', $this->email]); return $dataProvider; }
use yii\helpers\ArrayHelper; use common\models\Specialist; use common\models\SpecialistType; use common\models\Product; use common\models\ProductType; use common\models\ProductCat; use common\models\Diagnos; use common\models\Organization; use kartik\widgets\ActiveForm; use kartik\builder\Form; //Заболевания диагноз parent_id > 0 $catList = ArrayHelper::index(ProductCat::find()->where(['>', 'parent_id', 0])->asArray()->all(), 'id'); //Список организаций $orgList = ArrayHelper::index(Organization::find()->asArray()->all(), 'id'); $specList = ArrayHelper::index(Specialist::find()->asArray()->all(), 'id'); $specTypeList = ArrayHelper::index(SpecialistType::find()->asArray()->all(), 'id'); $diagnosList = ArrayHelper::index(Diagnos::find()->asArray()->all(), 'id'); $css = <<<CSS select.search_select { border: 0 none; width: 100%; border-bottom: 1px solid #A52024; border-left: 1px solid #A52024; padding: 3px 10px; } .select2-container--krajee .select2-selection { -webkit-box-shadow: none; box-shadow: none; background-color: #fff;
/** * Страница специалиста */ public function actionSpecialist($id) { return $this->render('specialist', ['item' => Specialist::find()->where(['id' => $id])->asArray()->one()]); }