Hi @softark,
These are my table columns
'id' => Yii::t('app', 'ID'),
'name' => Yii::t('app', 'Name'),
'unique_id' => Yii::t('app', 'Unique ID'),
'user_id' => Yii::t('app', 'User ID'),
'created_at' => Yii::t('app', 'Created At'),
'updated_at' => Yii::t('app', 'Updated At'),
'is_active' => Yii::t('app', 'Is Active'),
'tournament_id' => Yii::t('app', 'Tournament ID'),
'match_address' => Yii::t('app', 'Match Address'),
'match_city' => Yii::t('app', 'Match City'),
'match_state' => Yii::t('app', 'Match State'),
'match_country' => Yii::t('app', 'Match Country'),
'match_zipcode' => Yii::t('app', 'Match Zipcode'),
'ground_id' => Yii::t('app', 'Ground ID'),
'time' => Yii::t('app', 'Time'),
'date' => Yii::t('app', 'Date'),
'match_type' => Yii::t('app', 'Match Type'),
'format' => Yii::t('app', 'Format'),
'over' => Yii::t('app', 'Over'),
and there is nothing special in my model definition, it is generated model with gii tools with labels , rules and table name function
class Match extends ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'match';
}
}
and I have tried below mentioned code in my controller
if(isset($requestParams['upcoming']) && $requestParams['upcoming']==1){
$query->andHaving(['>=','date',date('Y-m-d')]);
}
$dataProvider = Yii::createObject([
'class' => ActiveDataProvider::className(),
'query' => $query,
'pagination' => [
'params' => $requestParams,
'pageSize'=>50,
],
'sort' => [
'params' => $requestParams,
],
]);