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);