Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Grabcorns::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, 'needed' => $this->needed, 'remain' => $this->remain, 'created_at' => $this->created_at, 'date' => $this->date, 'end_at' => $this->end_at, 'islotteried' => $this->islotteried, 'winneruserid' => $this->winneruserid, 'winnerrecordid' => $this->winnerrecordid, 'winnernumber' => $this->winnernumber, 'foruser' => $this->foruser, 'kind' => $this->kind, 'worth' => $this->worth]);
     $query->andFilterWhere(['like', 'picture', $this->picture])->andFilterWhere(['like', 'title', $this->title])->andFilterWhere(['like', 'version', $this->version])->andFilterWhere(['like', 'pictures', $this->pictures]);
     return $dataProvider;
 }
 /**
  * Finds the Applyjobs model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Applyjobs the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Grabcorns::findOne($id)) !== null) {
         return $model;
     } else {
         return false;
     }
 }
 /**
  * Finds the Grabcorns model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Grabcorns the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Grabcorns::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Example #4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getGrabcorn()
 {
     return $this->hasOne(Grabcorns::className(), ['id' => 'grabcornid']);
 }