浏览代码

Test pour réduction requete #624

develop
Fabien Normand 2 年前
父节点
当前提交
a5f5b4fd08
共有 2 个文件被更改,包括 9 次插入0 次删除
  1. +2
    -0
      Repository/Product/ProductCategoryRepositoryQuery.php
  2. +7
    -0
      Repository/Product/ProductFamilyStore.php

+ 2
- 0
Repository/Product/ProductCategoryRepositoryQuery.php 查看文件

@@ -26,6 +26,8 @@ class ProductCategoryRepositoryQuery extends AbstractRepositoryQuery

return $this
->innerJoin('.productFamilies', 'productFamilies');
//@GONE AWAY avec un addSelect('productFamilies') on gagne 10 requetes

}

return $this;

+ 7
- 0
Repository/Product/ProductFamilyStore.php 查看文件

@@ -65,6 +65,13 @@ class ProductFamilyStore extends AbstractStore
$productFamiliesArray = [];

foreach ($parentCategory->getChildrens() as $i => $category) {
//Essai d'alternative
// foreach ($category->getProductFamilies() as $productFamily) {
// if($productFamily->getStatus()==1) {
// $productFamiliesArray[$productFamily->getId()] = $productFamily;
// }
// }

$productFamiliesCategory = $this->getByCategory($category);
foreach ($productFamiliesCategory as $productFamily) {
$productFamiliesArray[$productFamily->getId()] = $productFamily;

正在加载...
取消
保存