If I have 2 fields in db - probability and influence and I need a column in GridView where these two fields are multiplied. I managed to add it there like:
Removed
$query->select('*, (probability * influence) as priority');
changed
'priority' => [
'asc' => ['(probability * influence)' => SORT_ASC],
'desc' => ['(probability * influence)' => SORT_DESC],
'label' => 'Priority',
],
and after $this->load($params);
$query->andFilterWhere(['=', '(probability * influence)', $this->priority]);
And search works as needed! :)
Thanks for help!