From c5e76275e879d7a8a3a7d609e26a8c8ab5432bc4 Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Wed, 27 Nov 2024 15:16:03 +0100 Subject: [PATCH] aa --- app/Http/Controllers/ArticleController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index b7ee7d78..91c8c7d5 100755 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -26,7 +26,7 @@ class ArticleController extends Controller $join->on('T_WEB_Articoli.IdStatoProdotto', '=', 'f.IdStatoProdotto'); } ) - ->whereIn('f.DescrizioneStatoProdotto', ['In commercio', 'In prevendita', 'Prossima uscita']) + ->whereIn('f.DescrizioneStatoProdotto', ['In commercio']) ->selectRaw(' T_WEB_Articoli.idArticolo, T_WEB_Articoli.Titolo, @@ -73,9 +73,11 @@ class ArticleController extends Controller $response->headers->set('Content-Type', 'text/csv'); $response->headers->set('Content-Disposition', 'attachment; filename="' . $filename . '"'); - $csvContent = "IdArticolo,Titolo,TotaleVenduto\n"; + + $csvContent = "IdArticolo,Titolo,TotaleVenduto,TotaleVendutoUltimoMese,TotaleVendutoUltimi6Mesi,TotaleVendutoUltimoAnno\n"; + foreach ($articoliVenduti as $articoloVenduto) { - $csvContent .= "{$articoloVenduto->idArticolo},{$articoloVenduto->Titolo},{$articoloVenduto->totaleVenduto}\n"; + $csvContent .= "{$articoloVenduto->idArticolo},{$articoloVenduto->Titolo},{$articoloVenduto->totaleVenduto},{$articoloVenduto->totaleVendutoUltimoMese},{$articoloVenduto->totaleVendutoUltimi6Mesi},{$articoloVenduto->totaleVendutoUltimoAnno}\n"; } $response->setContent($csvContent);