@@ -1388,11 +1388,11 @@ static public function getAgregateCategoryData(ActiveQuery $q, $model, $filtersD
1388
1388
$ baseTypePrice = \Yii::$ app ->shop ->baseTypePrice ;
1389
1389
1390
1390
$ q1 = clone $ q ;
1391
- $ q1 ->innerJoin (['prices ' => 'shop_product_price ' ], [
1392
- 'prices .product_id ' => new Expression ('shopProduct.id ' ),
1393
- 'prices .type_price_id ' => $ baseTypePrice ->id ,
1391
+ $ q1 ->innerJoin (['prices_for_calc ' => 'shop_product_price ' ], [
1392
+ 'prices_for_calc .product_id ' => new Expression ('shopProduct.id ' ),
1393
+ 'prices_for_calc .type_price_id ' => $ baseTypePrice ->id ,
1394
1394
]);
1395
- $ q1 ->select (['price ' => new Expression ("max(prices .price) " )]);
1395
+ $ q1 ->select (['price ' => new Expression ("max(prices_for_calc .price) " )]);
1396
1396
$ q1 ->groupBy (false );
1397
1397
$ q1 ->orderBy (false );
1398
1398
@@ -1405,12 +1405,12 @@ static public function getAgregateCategoryData(ActiveQuery $q, $model, $filtersD
1405
1405
1406
1406
1407
1407
$ q2 = clone $ q ;
1408
- $ q2 ->select (['price ' => new Expression ("min(prices .price) " )]);
1409
- $ q2 ->innerJoin (['prices ' => 'shop_product_price ' ], [
1410
- 'prices .product_id ' => new Expression ('shopProduct.id ' ),
1411
- 'prices .type_price_id ' => $ baseTypePrice ->id ,
1408
+ $ q2 ->select (['price ' => new Expression ("min(prices_for_calc .price) " )]);
1409
+ $ q2 ->innerJoin (['prices_for_calc ' => 'shop_product_price ' ], [
1410
+ 'prices_for_calc .product_id ' => new Expression ('shopProduct.id ' ),
1411
+ 'prices_for_calc .type_price_id ' => $ baseTypePrice ->id ,
1412
1412
]);
1413
- $ q2 ->andWhere (['> ' , 'prices .price ' , 0 ]);
1413
+ $ q2 ->andWhere (['> ' , 'prices_for_calc .price ' , 0 ]);
1414
1414
$ q2 ->orderBy (false );
1415
1415
$ q2 ->groupBy (false );
1416
1416
0 commit comments