public function actionIndex() { $HOSPCODE = \Yii::$app->request->post('HOSPCODE'); $PID = \Yii::$app->request->post('PID'); $SEQ = \Yii::$app->request->post('SEQ'); $DrugIpd = new DrugIpd(); $DrugOpd = new DrugOpd(); $data['drug_opd'] = $DrugIpd->Get_drug_ipd($HOSPCODE, $PID, $SEQ); $data['drug_ipd'] = $DrugOpd->Get_drug_opd($HOSPCODE, $PID, $SEQ); return $this->renderPartial('view', $data); }
public function actionIndex() { $HOSPCODE = \Yii::$app->request->post('HOSPCODE'); $PID = \Yii::$app->request->post('PID'); $SEQ = \Yii::$app->request->post('SEQ'); $result = DrugOpd::find()->where(['HOSPCODE' => $HOSPCODE, 'PID' => $PID, 'SEQ' => $SEQ])->all(); return $this->renderPartial('index', ['result' => $result]); }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = DrugOpd::find(); /*$query = DrugOpd::find() ->groupBy('DNAME') ->count();*/ $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); return $dataProvider; } $query->andFilterWhere(['DNAME' => $this->DNAME, 'DATE_SERV' => $this->DATE_SERV, 'AMOUNT' => $this->AMOUNT, 'DRUGPRICE' => $this->DRUGPRICE, 'DRUGCOST' => $this->DRUGCOST, 'D_UPDATE' => $this->D_UPDATE]); $query->andFilterWhere(['like', 'HOSPCODE', $this->HOSPCODE])->andFilterWhere(['like', 'PID', $this->PID])->andFilterWhere(['like', 'SEQ', $this->SEQ])->andFilterWhere(['like', 'CLINIC', $this->CLINIC])->andFilterWhere(['like', 'DIDSTD', $this->DIDSTD])->andFilterWhere(['like', 'DNAME', $this->DNAME])->andFilterWhere(['like', 'UNIT', $this->UNIT])->andFilterWhere(['like', 'UNIT_PACKING', $this->UNIT_PACKING])->andFilterWhere(['like', 'PROVIDER', $this->PROVIDER]); return $dataProvider; }
/** * Finds the DrugOpd model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $HOSPCODE * @param string $PID * @param string $SEQ * @param string $DIDSTD * @return DrugOpd the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($HOSPCODE, $PID, $SEQ, $DIDSTD) { if (($model = DrugOpd::findOne(['HOSPCODE' => $HOSPCODE, 'PID' => $PID, 'SEQ' => $SEQ, 'DIDSTD' => $DIDSTD])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }