浏览代码

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/LcShopBundle into develop

feature/export_comptable
Fab 4 年前
父节点
当前提交
7a5d578429
共有 2 个文件被更改,包括 15 次插入0 次删除
  1. +13
    -0
      ShopBundle/Model/ProductCategory.php
  2. +2
    -0
      ShopBundle/Repository/ProductCategoryRepository.php

+ 13
- 0
ShopBundle/Model/ProductCategory.php 查看文件

@@ -130,6 +130,19 @@ abstract class ProductCategory extends AbstractDocumentEntity implements TreeInt
return $this;
}

public function countProductFamilies($status = null)
{
$count = 0 ;

foreach($this->getProductFamilies() as $productFamily) {
if($status === null || ($status !== null && $productFamily->getStatus() == $status)) {
$count ++ ;
}
}

return $count ;
}

public function getMerchant(): ?Merchant
{
return $this->merchant;

+ 2
- 0
ShopBundle/Repository/ProductCategoryRepository.php 查看文件

@@ -42,6 +42,8 @@ class ProductCategoryRepository extends BaseRepository implements DefaultReposit

if ($withOffline) $query->andWhere('e.status >= 0');
else $query->andWhere('e.status = 1');
$query->leftJoin('e.productFamilies','productFamilies') ;

$query->orderBy('e.position', 'ASC');


正在加载...
取消
保存