aa
This commit is contained in:
@@ -232,7 +232,7 @@ class ArticleController extends Controller
|
||||
->leftJoin(DB::raw('(SELECT CodArticolo, SUM(TRY_CAST(Qta AS INT)) as totFat FROM T_WEB_ArticoliFatturati WHERE ISNUMERIC(Qta) = 1 GROUP BY CodArticolo) u'), function ($join) {
|
||||
$join->on('T_WEB_Articoli.IdArticolo', '=', 'u.CodArticolo');
|
||||
})
|
||||
/*->leftJoin(DB::raw('(
|
||||
->leftJoin(DB::raw('(
|
||||
SELECT v.IdCollana, v.Descrizione as DescrizioneCollana
|
||||
FROM T_WEB_Collane v
|
||||
INNER JOIN (
|
||||
@@ -247,15 +247,15 @@ class ArticleController extends Controller
|
||||
JOIN (SELECT IdArgomento, MAX(DataOra) as data12 from T_WEB_Argomenti GROUP BY IdArgomento) h2
|
||||
ON g2.IdArgomento = h.IdArgomento AND g2.DataOra = h.data12 ) i2'), function ($join) {
|
||||
$join->on('T_WEB_Articoli.ListaArgomenti', '=', 'i2.IdArgomento');
|
||||
})*/
|
||||
})
|
||||
|
||||
->select(
|
||||
'T_WEB_Articoli.*',
|
||||
'f.DescrizioneStatoProdotto',
|
||||
/*'f.DescrizioneStatoProdotto',
|
||||
'i.DescrizioneTipologia',
|
||||
'n.DescrizioneFormato',
|
||||
'y.DescrizioneCollana',
|
||||
'i2.DescrArgomento',
|
||||
// 'y.DescrizioneCollana',
|
||||
// 'i2.DescrArgomento',
|
||||
DB::raw('COALESCE(o.totVen, 0) as totVen'),
|
||||
DB::raw('COALESCE(u.totFat, 0) as totFat'),
|
||||
DB::raw('COALESCE(p.venduti3mesi, 0) as venduti3mesi'),
|
||||
@@ -265,13 +265,13 @@ class ArticleController extends Controller
|
||||
DB::raw('COALESCE(q.venduti6mesi, 0) as venduti6mesi'),
|
||||
DB::raw('COALESCE(q.rank6M, 0) as rank6M'),
|
||||
DB::raw('COALESCE(r.venduti1anno, 0) as venduti1anno'),
|
||||
DB::raw('COALESCE(r.rank1Y, 0) as rank1Y'),
|
||||
DB::raw('COALESCE(r.rank1Y, 0) as rank1Y'),*/
|
||||
DB::raw('s.ultimoOrdine')
|
||||
)
|
||||
->where('DescrizioneStatoProdotto', 'In commercio')
|
||||
->where('DescrizioneTipologia', 'Libri')
|
||||
//->orderBy('rank1Y', 'asc')
|
||||
->orderBy('totVen', 'desc')
|
||||
// ->orderBy('totVen', 'desc')
|
||||
->get();
|
||||
|
||||
if ($articoliVenduti->isEmpty()) {
|
||||
@@ -591,7 +591,7 @@ class ArticleController extends Controller
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return new Response('Error exporting exportArticlesSalesByJSON_Base: ' . $e->getMessage() . 'Articoli: ' . json_decode($articoliVenduti), 500);
|
||||
return new Response('Error exporting exportArticlesSalesByJSON_Base: ' . $e->getMessage() . '\n Articoli: ' . json_decode($articoliVenduti), 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user