예제 #1
0
 public function sectionByYear()
 {
     $response = array();
     $infos = Years::find(Input::get('drpYearLvl'))['listBySection'];
     if (!empty($infos)) {
         foreach ($infos as $info) {
             $response[] = array("info_id" => $info['id'], "year" => $this->yearInfo($info['year_id'])['description'], "year_id" => $info['year_id'], "data_description" => $info['description']);
         }
     }
     return $response;
 }
예제 #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Years::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(['id' => $this->id]);
     $query->andFilterWhere(['like', 'year', $this->year]);
     return $dataProvider;
 }