소스 검색

[Administration] Produits : import CSV prix spécifiques #959

refactoring
Guillaume Bourgeois 1 년 전
부모
커밋
f1a33db2dc
1개의 변경된 파일13개의 추가작업 그리고 9개의 파일을 삭제
  1. +13
    -9
      backend/controllers/ProductController.php

+ 13
- 9
backend/controllers/ProductController.php 파일 보기

@@ -443,6 +443,8 @@ class ProductController extends BackendController

$productArray = $productManager->findProducts();
foreach($productArray as $product) {

// prix produit
$data[] = [
$product->name,
'',
@@ -452,18 +454,20 @@ class ProductController extends BackendController
$product->price
];

// prix spécifiques
foreach($product->productPrice as $productPrice) {

$productPrice = $productPriceManager->findOneProductPriceById($productPrice->id);

$data[] = [
$product->name,
$productPrice->user ? $userManager->getUsername($productPrice->user).' #'.$productPrice->user->id : '',
$productPrice->userGroup ? $productPrice->userGroup->name : '',
$productPrice->pointSale ? $productPrice->pointSale->name : '',
$productPrice->from_quantity ?? '',
$productPrice->price
];
if($productPrice->user || $productPrice->userGroup || $productPrice->pointSale || $productPrice->from_quantity) {
$data[] = [
$product->name,
$productPrice->user ? str_replace('#', '', $userManager->getUsername($productPrice->user)).' #'.$productPrice->user->id : '',
$productPrice->userGroup ? $productPrice->userGroup->name : '',
$productPrice->pointSale ? $productPrice->pointSale->name : '',
$productPrice->from_quantity ?? '',
$productPrice->price
];
}
}
}


Loading…
취소
저장