Пример #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = PlafonKacamata::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         $query->where('1=0');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'status_peserta_id' => $this->status_peserta_id, 'hak_kacamata_id' => $this->hak_kacamata_id, 'biaya' => $this->biaya]);
     $query->andFilterWhere(['like', 'band', $this->band]);
     return $dataProvider;
 }
Пример #2
0
 /**
  * Finds the PlafonKacamata model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return PlafonKacamata the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = PlafonKacamata::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPlafonKacamatas()
 {
     return $this->hasMany(PlafonKacamata::className(), ['hak_kacamata_id' => 'id']);
 }
 public function actionGetDataPlafon($hak_kacamata_id, $band = null, $status_peserta_id = null)
 {
     $dataPlafon = PlafonKacamata::find()->where(['hak_kacamata_id' => $hak_kacamata_id])->andWhere(['band' => $band])->andWhere(['status_peserta_id' => $status_peserta_id])->one();
     echo Json::encode($dataPlafon);
 }