Browse Source

Merge branch 'develop'

master^2
Guillaume 3 years ago
parent
commit
9d4ccd69af
3 changed files with 2 additions and 17 deletions
  1. +1
    -1
      ShopBundle/Model/OrderShop.php
  2. +0
    -15
      ShopBundle/Repository/OrderShopRepository.php
  3. +1
    -1
      ShopBundle/Resources/public/js/backend/script/order/vuejs-order.js

+ 1
- 1
ShopBundle/Model/OrderShop.php View File

protected $orderPayments; protected $orderPayments;


/** /**
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderProductInterface", mappedBy="orderShop", cascade={"persist", "remove"}, orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\ShopBundle\Context\OrderProductInterface", mappedBy="orderShop", cascade={"persist", "remove"}, orphanRemoval=true, fetch="EAGER")
*/ */
protected $orderProducts; protected $orderProducts;



+ 0
- 15
ShopBundle/Repository/OrderShopRepository.php View File

} }




public function countValidOrderProductsOfWeekByProduct($weekNumber, $productId)
{
$query = $this->findByMerchantQuery();
$query = $this->filterOrderValid($query);
$query->andWhere('e.weekNumber = :weekNumber');
$query->setParameter('weekNumber', $weekNumber);
$query->leftJoin('e.orderProducts', 'orderProduct');
$query->andWhere('orderProduct.product = :product');
$query->setParameter('product', $productId);
$query->select('SUM(orderProduct.quantityOrder) as quantity');

$result = $query->getQuery()->getOneOrNullResult();


return $result['quantity'];

}
} }

+ 1
- 1
ShopBundle/Resources/public/js/backend/script/order/vuejs-order.js View File

} }
}, },
preventFormSubmit: function (){ preventFormSubmit: function (){
$(document).keypress(function(e) {
$('#lc-order-edit').keypress(function(e) {
if (e.which == 13) { if (e.which == 13) {
e.preventDefault(); e.preventDefault();
} }

Loading…
Cancel
Save