public function actionDiagnosaTht() { $gejala = !empty($_POST['Diagnosa']['proses']) ? $_POST['Diagnosa']['proses'] : array(0); $model = PenyakitGejala::find()->all(); $diagnosa = new Diagnosa(); $dd = $diagnosa->diagnosaData($gejala); $uncertantyTerm = new \common\models\DiagnosaUncertantyTerm(); return $this->render('diagnosa', ['model' => $model, 'diagnosa' => $diagnosa, 'dd' => $dd, 'hasil' => $diagnosa->rekapDiagnosa($dd), 'uncertantyTerm' => $uncertantyTerm]); }
public function search($params) { $query = PenyakitGejala::find(); $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['id' => 'DESC']], 'pagination' => ['defaultPageSize' => 10]]); $this->load($params); if (!$this->validate()) { $query->where('1=0'); return $dataProvider; } /* $dataProvider->query->joinWith([ 'parentGroup'=> function ($q){ $q->from('tb_group tb_group2'); // join with tabel alias } ]); $query->andFilterWhere(['like', 'tb_group.name', $this->name]); $query->andFilterWhere(['like', 'tb_group2.name', $this->parent_id]); // SELESAI EDIT DISINI */ $query->andFilterWhere(['status' => $this->status]); $query->orFilterWhere(['like', 'nama_gejala', $this->srch_all])->orFilterWhere(['like', 'ket', $this->srch_all]); return $dataProvider; }
protected function findModel($id) { if (($model = PenyakitGejala::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
public function listGejala() { $data = ArrayHelper::map(\backend\models\PenyakitGejala::find()->where('id in (select gejala_id from diagnosa)')->all(), 'id', 'nama_gejala'); return $data; }