浏览代码

Produit stock negatif

feature/export_comptable
Fab 4 年前
父节点
当前提交
f58f3bb249
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. +1
    -1
      ShopBundle/Resources/views/backend/default/menu.html.twig
  2. +5
    -0
      ShopBundle/Twig/BackendTwigExtension.php

+ 1
- 1
ShopBundle/Resources/views/backend/default/menu.html.twig 查看文件

@@ -24,7 +24,7 @@
{% if item.icon is not empty %}<i class="fa fa-fw {{ item.icon }}"></i>{% endif %}
<p>{{ item.label|trans(domain = translation_domain) }}
{% if item.children|default([]) is not empty %}<i class="right fas fa-angle-left"></i>{% endif %}
{% if item.params.count_menu_item is defined %}<span class="badge badge-info right">{{ count_menu_items(item.params.count_menu_item) }}</span>{% endif %}
{% if item.params.count_menu_item is defined %}<span class="badge badge-{{ item.params.alert is defined ? 'danger' : 'info' }} right">{{ count_menu_items(item.params.count_menu_item) }}</span>{% endif %}
</p>
</a>
{% endif %}

+ 5
- 0
ShopBundle/Twig/BackendTwigExtension.php 查看文件

@@ -3,8 +3,10 @@
namespace Lc\ShopBundle\Twig;

use Doctrine\ORM\EntityManagerInterface;
use Lc\ShopBundle\Context\ProductInterface;
use Lc\ShopBundle\Context\ReductionCartInterface;
use Lc\ShopBundle\Context\TicketInterface;
use Lc\ShopBundle\Repository\ProductRepository;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
@@ -83,6 +85,9 @@ class BackendTwigExtension extends AbstractExtension
case 'ticket' :
$ticketRepo = $this->em->getRepository(TicketInterface::class);
return $ticketRepo->countAllOpen();
case 'productAvailabilitiesNegative' :
$productRepo = $this->em->getRepository(ProductInterface::class);
return count($productRepo->findProductByAvailabilitiesNegative());

}
}

正在加载...
取消
保存