修改了 分类页面-规格产品只显示一个sku 为yes 导致分类页面异常
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 'fecshop.product_flat.sku' 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 `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 ('43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54')) AND (`status`=1) GROUP BY `spu` ORDER BY `score` DESC) `c`
Error Info: Array
(
[0] => 42000
[1] => 1055
[2] => Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'fecshop.product_flat.sku' 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 'fecshop.product_flat.sku' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
in /www/web/fecshop/vendor/yiisoft/yii2/db/Command.php at line 1290
本文由 Ngeora 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。
可自由转载、引用,但需署名作者且注明文章出处。