-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Closed
Labels
Description
I am trying to filter data using dropdown so the query executed perfectly produces a result is always correct but in summary total count is '0' always but not first time when page loaded. This is annoying me I am completely unable to trace the error through debugging tool. But the important thing is that the same code is working fine on my local machine whenever I deployed the same code to production it shows 0 counts
My Model search code :
`public function search($params) {
$query = Tasks::find();
$query->where(['q_id' => $this->job_id]);
// $query->orderBy('created_at DESC');
$dataProvider = new ActiveDataProvider([
'query' => $query,
'pagination' => [
'pageSize' => 20,
],
]);
$this->load($params);
if (!empty($this->keyword) || $this->keyword != '') {
$query->andWhere('MATCH(task_title,task_description, priority) AGAINST("' . $this->keyword . '*" IN BOOLEAN MODE)');
}
if (is_numeric($this->filterby)) {
$query->andFilterWhere(['status' => $this->filterby]);
} else {
$query->andFilterWhere(['IN', 'status', [10, 4, 2]]);
}
if (!empty($this->sortby) || $this->sortby != '') {
$query->orderBy($this->sortby . ' DESC');
}
return $dataProvider;
}`