Просмотр исходного кода

Merge branch 'develop'

develop
Guillaume 3 лет назад
Родитель
Сommit
876716d2b2
3 измененных файлов: 5 добавлений и 5 удалений
  1. +2
    -2
      ShopBundle/Resources/views/backend/default/block/macros.html.twig
  2. +1
    -1
      ShopBundle/Resources/views/backend/user/show.html.twig
  3. +2
    -2
      ShopBundle/Services/Order/OrderUtilsReductionTrait.php

+ 2
- 2
ShopBundle/Resources/views/backend/default/block/macros.html.twig Просмотреть файл

@@ -331,7 +331,7 @@



{% macro list_reduction_credits(reductionCredits) %}
{% macro list_reduction_credits(reductionCredits, user) %}
<table class="table table-condensed">
<thead>
<tr>
@@ -344,7 +344,7 @@
</thead>
<tbody>
{% for reductionCredit in reductionCredits %}
{% set isUsed = orderUtils.isReductionCreditUsed(reductionCredit) %}
{% set isUsed = orderUtils.isReductionCreditUsed(reductionCredit, user) %}
<tr>
<td>{{ reductionCredit.title }}</td>
<td>

+ 1
- 1
ShopBundle/Resources/views/backend/user/show.html.twig Просмотреть файл

@@ -53,7 +53,7 @@

{% if entity.reductionCredits|length %}
{{ macros.card_start('ReductionCredit.list', 'warning card-outline', false) }}
{{ macros.list_reduction_credits(entity.reductionCredits) }}
{{ macros.list_reduction_credits(entity.reductionCredits, entity) }}
{{ macros.card_end() }}
{% endif %}


+ 2
- 2
ShopBundle/Services/Order/OrderUtilsReductionTrait.php Просмотреть файл

@@ -200,8 +200,8 @@ trait OrderUtilsReductionTrait
}
}

public function isReductionCreditUsed($reductionCredit){
if($this->orderShopRepo->countValidOrderWithReductionCredit($reductionCredit)) {
public function isReductionCreditUsed($reductionCredit, $user = false){
if($this->orderShopRepo->countValidOrderWithReductionCredit($reductionCredit, $user)) {
return true;
}else{
return false;

Загрузка…
Отмена
Сохранить