コード例 #1
0
ファイル: CmbisKpiSearch.php プロジェクト: cmbis/cmbis
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = CmbisKpi::find();
     $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(['kpi_id' => $this->kpi_id, 'kpi_percent_target' => $this->kpi_percent_target, 'kpi_group' => $this->kpi_group]);
     $query->andFilterWhere(['like', 'kpi_name', $this->kpi_name])->andFilterWhere(['like', 'kpi_b_year', $this->kpi_b_year])->andFilterWhere(['like', 'kpi_function', $this->kpi_function])->andFilterWhere(['like', 'kpi_desc', $this->kpi_desc]);
     return $dataProvider;
 }
コード例 #2
0
ファイル: KpiController.php プロジェクト: cmbis/cmbis
 /**
  * Finds the CmbisKpi model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $kpi_id
  * @param string $kpi_b_year
  * @return CmbisKpi the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($kpi_id, $kpi_b_year)
 {
     if (($model = CmbisKpi::findOne(['kpi_id' => $kpi_id, 'kpi_b_year' => $kpi_b_year])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #3
0
ファイル: CmbisKpiResult.php プロジェクト: cmbis/cmbis
 public function getKpitable()
 {
     return $this->hasOne(CmbisKpi::className(), ['kpi_id' => 'kpi_id']);
 }