Browse Source

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

feature/export_comptable
Fab 4 years ago
parent
commit
7a5d578429
2 changed files with 15 additions and 0 deletions
  1. +13
    -0
      ShopBundle/Model/ProductCategory.php
  2. +2
    -0
      ShopBundle/Repository/ProductCategoryRepository.php

+ 13
- 0
ShopBundle/Model/ProductCategory.php View File

return $this; 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 public function getMerchant(): ?Merchant
{ {
return $this->merchant; return $this->merchant;

+ 2
- 0
ShopBundle/Repository/ProductCategoryRepository.php View File



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


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



Loading…
Cancel
Save