/var/www/vhosts/nabawater/backend/models
Edit: /var/www/vhosts/nabawater/backend/models/NotificationSearch.php (1768B)
alias('N')
->select('N.*')
->where(['<>', 'N.status', Notification::DELETE])
->orderBy(['N.notification_id' => SORT_DESC]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'PageSize' => Com::postPerPage(),
],
'sort' => [
'attributes' => [
'notification_title',
'notification_description',
],
'defaultOrder' => [
'notification_title' => SORT_ASC,
'notification_description' => SORT_DESC
]
]
]);
$this->load($params);
if(!$this->validate()) {
return $dataProvider;
}
$query->andFilterWhere(['like', 'N.notification_title', strtolower($this->notification_title)])
->andFilterWhere(['like', 'N.notification_description', $this->notification_description])
->andFilterWhere(['like', 'N.app_type', $this->app_type]);
return $dataProvider;
}
}