Database Exception – yii\db\Exception
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'rentaltrans.item.alias' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
The SQL being executed was: SELECT COUNT(*) FROM (SELECT `item`.* FROM `item` LEFT JOIN `user` ON `item`.`user_id` = `user`.`id` LEFT JOIN `order` ON `item`.`id` = `order`.`item_id` WHERE ((`user`.`status`=10) AND (`item`.`status`='available') AND (`item`.`deleted`=0)) AND (`user`.`hide_items`=0) AND (`category_id`=1) GROUP BY `item`.`id` ORDER BY `order`.`id` DESC) `c`
Помогите решить проблему.
Вот мой код.
$item = Item::find()
->joinWith(['user', 'order'])
->where(['user.status' => User::STATUS_ACTIVE,'item.status' => 'available', 'item.deleted' => 0])
->andWhere(['user.hide_items' => 0])
->groupBy('item.id');