aa
This commit is contained in:
@@ -200,7 +200,7 @@ class ArticleController extends Controller
|
||||
->leftJoin(DB::raw('(SELECT CodArticoloGM, SUM(Qta) as totVen FROM T_WEB_Ordini GROUP BY CodArticoloGM) o'), function ($join) {
|
||||
$join->on('T_WEB_Articoli.IdArticolo', '=', 'o.CodArticoloGM');
|
||||
})
|
||||
->leftJoin(DB::raw('(SELECT CodArticoloGM, SUM(Qta) as venduti3mesi, RANK() OVER (ORDER BY SUM(Qta) DESC) as rank3M
|
||||
/*->leftJoin(DB::raw('(SELECT CodArticoloGM, SUM(Qta) as venduti3mesi, RANK() OVER (ORDER BY SUM(Qta) DESC) as rank3M
|
||||
FROM T_WEB_Ordini
|
||||
WHERE DataOra >= DATEADD(MONTH, -3, GETDATE())
|
||||
GROUP BY CodArticoloGM) p'), function ($join) {
|
||||
@@ -248,14 +248,15 @@ class ArticleController extends Controller
|
||||
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',
|
||||
'T_WEB_Articoli.*'
|
||||
/*', 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,12 +266,11 @@ 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('s.ultimoOrdine')
|
||||
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')
|
||||
->get();
|
||||
|
||||
@@ -550,7 +550,7 @@ class ArticleController extends Controller
|
||||
$articoliVenduti = $this->queryArticlesSales();
|
||||
}
|
||||
|
||||
if ($articoliVenduti) {
|
||||
if ($articoliVenduti->isNotEmpty()) {
|
||||
|
||||
// Mappa i risultati nella struttura JSON desiderata
|
||||
$result = $articoliVenduti->map(function ($articoloVenduto) {
|
||||
@@ -591,7 +591,7 @@ class ArticleController extends Controller
|
||||
}
|
||||
|
||||
} catch (\Exception $e) {
|
||||
return new Response('Error exporting exportArticlesSalesByJSON_Base: ' . $e->getMessage() . '\n Articoli: ' . json_decode($articoliVenduti), 500);
|
||||
return new Response('Error exporting exportArticlesSalesByJSON_Base: ' . $e->getMessage() . '<br>Articoli: ' . json_decode($articoliVenduti), 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2221,7 +2221,7 @@ Route::get('/testcli', function () {
|
||||
$cliente->Telefono = '';
|
||||
$cliente->Email = 'email@email.com';
|
||||
$cliente->CodClienteGM = '';
|
||||
$cliente->IdNazione = 227; // ITALIA
|
||||
$cliente->IdNazione = 227; // ITALIA
|
||||
$cliente->IdInternet = 68499;
|
||||
try {
|
||||
$cliente->save();
|
||||
@@ -2369,7 +2369,7 @@ Route::post('/updatecreate', function (Request $request) {
|
||||
$cliente = null;
|
||||
if ($clienteinGM) {
|
||||
$productLogger->addLog('', 'Cliente su GM! ' . json_encode($clienteinGM) . 'con IdInternet=' . $myidInternet);
|
||||
// $cliente = $clienteinGM;
|
||||
// $cliente = $clienteinGM;
|
||||
}
|
||||
|
||||
if ($cliente === null) {
|
||||
@@ -2395,7 +2395,7 @@ Route::post('/updatecreate', function (Request $request) {
|
||||
$cliente->Email = $email;
|
||||
$cliente->CodClienteGM = $codClienteGM;
|
||||
if ($nazione == 'IT') {
|
||||
$cliente->IdNazione = 227; // ITALIA
|
||||
$cliente->IdNazione = 227; // ITALIA
|
||||
} else {
|
||||
//++DA FARE !! PER ALTRE NAZIONI
|
||||
$cliente->IdNazione = $nazione;
|
||||
@@ -2464,7 +2464,7 @@ Route::post('/updatecreate', function (Request $request) {
|
||||
$clientedest->Telefono = $telefono;
|
||||
$clientedest->Email = $email;
|
||||
if ($nazione == 'IT') {
|
||||
$clientedest->IdNazione = 227; // ITALIA
|
||||
$clientedest->IdNazione = 227; // ITALIA
|
||||
} else {
|
||||
//++DA FARE !! PER ALTRE NAZIONI
|
||||
$clientedest->IdNazione = $nazione;
|
||||
@@ -2495,7 +2495,7 @@ Route::post('/updatecreate', function (Request $request) {
|
||||
}
|
||||
|
||||
// $productLogger->setLogandSendEmail('Check Ordine... ');
|
||||
} //end if status
|
||||
} //end if status
|
||||
|
||||
|
||||
} catch (Exception $e) {
|
||||
|
||||
Reference in New Issue
Block a user