/var/www/vhosts/nabawater/backend/models
Edit: /var/www/vhosts/nabawater/backend/models/UserPromotionSearch.php (1853B)
alias('U')
->select('U.*')
->where(['<>', 'U.user_promotion_status', AddressType::DELETE]);
UserPromotion::selectTranslation($query);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'PageSize' => Com::postPerPage(),
],
'sort' => [
'attributes' => [
'user_promotion_name',
'promotion_value',
],
'defaultOrder' => SORT_ASC
]
]);
$this->load($params);
if(!$this->validate()) {
return $dataProvider;
}
$query->andFilterWhere(['like', 'UL.user_promotion_name', strtolower($this->user_promotion_name)])
->andFilterWhere(['like', 'U.promotion_value', $this->promotion_value])
->andFilterWhere(['like', 'U.user_promotion_type', $this->user_promotion_type])
->andFilterWhere(['like', 'U.user_promotion_status', $this->user_promotion_status]);
return $dataProvider;
}
}