Database Exception – yii\db\Exception
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'product2.id' 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 FROM (SELECT id
, sku
, spu
, name
, image
, price
, special_price
, special_from
, special_to
, url_key
, score
, reviw_rate_star_average
, review_count
, favorite_count
, created_at
, qty
, final_price
FROM product_flat
WHERE (id
IN ('113', '114', '115', '116', '117', '118', '119', '120', '121', '122', '123', '124', '125', '126', '127', '128', '129', '130', '131', '132', '133', '134', '135', '136', '136')) AND (status
=1) ORDER BY score
DESC) product2
GROUP BY spu
) c
Error Info: Array
(
[0] => 42000
[1] => 1055
[2] => Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'product2.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
)
↵
Caused by: PDOException
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'product2.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
in /home/www/fecmall/vendor/yiisoft/yii2/db/Command.php at line 1299
fecmall 版本 2.7.X