|
|
|
|
|
|
|
|
|
|
|
|
|
|
$productArray = $productManager->findProducts(); |
|
|
$productArray = $productManager->findProducts(); |
|
|
foreach($productArray as $product) { |
|
|
foreach($productArray as $product) { |
|
|
|
|
|
|
|
|
|
|
|
// prix produit |
|
|
$data[] = [ |
|
|
$data[] = [ |
|
|
$product->name, |
|
|
$product->name, |
|
|
'', |
|
|
'', |
|
|
|
|
|
|
|
|
$product->price |
|
|
$product->price |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
// prix spécifiques |
|
|
foreach($product->productPrice as $productPrice) { |
|
|
foreach($product->productPrice as $productPrice) { |
|
|
|
|
|
|
|
|
$productPrice = $productPriceManager->findOneProductPriceById($productPrice->id); |
|
|
$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 |
|
|
|
|
|
]; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|