瀏覽代碼

[backend] Documents : correction bug total produits

refactoring
Guillaume 4 年之前
父節點
當前提交
6b33d27c1b
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. +5
    -3
      common/models/Document.php

+ 5
- 3
common/models/Document.php 查看文件

@@ -336,11 +336,13 @@ class Document extends ActiveRecordCommon
public function getProductsOrders()
{
$productsOrdersArray = [];
if ($this->orders && count($this->orders)) {
foreach ($this->orders as $order) {
$ordersArray = $this->orders ;
if ($ordersArray && count($ordersArray)) {
foreach ($ordersArray as $order) {
foreach ($order->productOrder as $productOrder) {
if (!isset($productsOrdersArray[$productOrder->id_product])) {
$productsOrdersArray[$productOrder->id_product] = [$productOrder];
$newProductOrder = clone $productOrder ;
$productsOrdersArray[$productOrder->id_product] = [$newProductOrder];
} else {
$productOrderMatch = false;
foreach ($productsOrdersArray[$productOrder->id_product] as &$theProductOrder) {

Loading…
取消
儲存