Beispiel #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = ItemProgramacao::find()->where(['evento_idevento' => $params['idevento']]);
     $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(['iditemProgramacao' => $this->iditemProgramacao, 'hora' => $this->hora, 'vagas' => $this->vagas, 'cargaHoraria' => $this->cargaHoraria, 'local_idlocal' => $this->local_idlocal, 'evento_idevento' => $this->evento_idevento, 'tipo_idtipo' => $this->tipo_idtipo]);
     $query->andFilterWhere(['like', 'titulo', $this->titulo])->andFilterWhere(['like', 'descricao', $this->descricao])->andFilterWhere(['like', 'data', $this->data])->andFilterWhere(['like', 'detalhe', $this->detalhe])->andFilterWhere(['like', 'notificacao', $this->notificacao]);
     return $dataProvider;
 }
Beispiel #2
0
 public function getListaItem($id_evento)
 {
     $model = ItemProgramacao::find()->select(['evento.sigla', 'itemProgramacao.iditemProgramacao', 'itemProgramacao.titulo', 'itemProgramacao.descricao'])->leftJoin("evento", "evento.idevento = itemProgramacao.evento_idevento")->where('evento_idevento = "' . $id_evento . '"')->all();
     return $model;
 }
Beispiel #3
0
 public function possuiItemProgramacao()
 {
     $id_evento = Yii::$app->request->post('evento_idevento');
     $results = ItemProgramacao::find()->where(['evento_idevento' => $id_evento])->count();
     return $results;
 }