diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index 1ac2040d..322e0d80 100755 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -275,7 +275,7 @@ class ArticleController extends Controller DB::raw('COALESCE(u.totFat, 0) as totFat'), DB::raw('COALESCE(p.venduti3mesi, 0) as venduti3mesi'), DB::raw('COALESCE(t.fat3mesi, 0) as fat3mesi'), - DB::raw('COALESCE(t2.fat6mesi, 0) as fat6mesi'), + DB::raw('COALESCE(t.fat6mesi, 0) as fat6mesi'), DB::raw('COALESCE(p.rank3M, 0) as rank3M'), DB::raw('COALESCE(t.fatrank3M, 0) as fatrank3M'), DB::raw('COALESCE(t2.fatrank6M, 0) as fatrank6M'), @@ -298,12 +298,11 @@ class ArticleController extends Controller } catch (\Exception $e) { // Registrazione dell'errore - echo "Errore: " . $e->getMessage(); return response()->json(['error' => 'Si รจ verificato un errore durante il recupero dei dati: ' . $e->getMessage()], 500); } // Restituisci una risposta JSON con i dati - return response()->json(['data' => $articoliVenduti]); + return $articoliVenduti; } private function queryArticlesFatturati() @@ -568,44 +567,13 @@ class ArticleController extends Controller $articoliVenduti = $this->queryArticlesFatturati(); } else { $articoliVenduti = $this->queryArticlesSales(); - // ritorna response()->json(['data' => $articoliVenduti]); } - if (true) { - echo $articoliVenduti; - echo '
| IdArticolo | Titolo | DataPubblicazione | ISBN | IdCollana | DescrizioneCollana | DescrArgomento | ListaArgomenti | Pagine | IdTipoFormato | Misure | totVen | totFat | rank3M | fatrank3M | fatrank6M | rank6M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ' . htmlspecialchars($articolo->IdArticolo) . ' | '; - echo '' . htmlspecialchars($articolo->Titolo) . ' | '; - echo '' . htmlspecialchars($articolo->DataPubblicazione) . ' | '; - echo '' . htmlspecialchars($articolo->Ean13) . ' | '; - echo '' . htmlspecialchars($articolo->IdCollana) . ' | '; - echo '' . htmlspecialchars($articolo->DescrizioneCollana) . ' | '; - echo '' . htmlspecialchars($articolo->DescrArgomento) . ' | '; - echo '' . htmlspecialchars($articolo->ListaArgomenti) . ' | '; - echo '' . htmlspecialchars($articolo->Pagine) . ' | '; - echo '' . htmlspecialchars($articolo->IdTipoFormato) . ' | '; - echo '' . htmlspecialchars($articolo->Misure) . ' | '; - echo '' . htmlspecialchars($articolo->totVen) . ' | '; - echo '' . htmlspecialchars($articolo->totFat) . ' | '; - echo '' . htmlspecialchars($articolo->rank3M) . ' | '; - echo '' . htmlspecialchars($articolo->fatrank3M) . ' | '; - echo '' . htmlspecialchars($articolo->fatrank6M) . ' | '; - echo '' . htmlspecialchars($articolo->rank6M) . ' | '; - echo '