diff --git a/app/Console/Commands/ProductUpdateDataPubb.php b/app/Console/Commands/ProductUpdateDataPubb.php index 7b23f333..852461d2 100755 --- a/app/Console/Commands/ProductUpdateDataPubb.php +++ b/app/Console/Commands/ProductUpdateDataPubb.php @@ -50,7 +50,7 @@ class ProductUpdateDataPubb extends Command try { set_time_limit(0); ini_set("memory_limit", "512M"); - $productLogger = new ProductLogger(null, '', true); + $productLogger = new ProductLogger(null, '', true); $articles = Article::join(DB::raw('(SELECT IdArticolo, MAX(DataOra) AS data FROM T_WEB_Articoli GROUP BY IdArticolo) b'), function ($join) { $join->on('T_WEB_Articoli.IdArticolo', '=', 'b.IdArticolo') @@ -68,10 +68,12 @@ class ProductUpdateDataPubb extends Command ->where(function ($query) { $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') ->orWhere('DescrizioneStatoProdotto', 'In prevendita') ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); }) - ->orderBy('Titolo') + ->orderBy('Titolo') ->take(1) ->get(); @@ -93,7 +95,7 @@ class ProductUpdateDataPubb extends Command if ($productLogger) { $productLogger->addLog('Error', $e->getMessage()); $productLogger->setLogandSendEmail('Aggiornamento Prodotti'); - } + } } } diff --git a/app/Console/Commands/ProductUpdateGm.php b/app/Console/Commands/ProductUpdateGm.php index 3978c199..2ef57342 100755 --- a/app/Console/Commands/ProductUpdateGm.php +++ b/app/Console/Commands/ProductUpdateGm.php @@ -51,7 +51,7 @@ class ProductUpdateGm extends Command ini_set("memory_limit", "512M"); $settingora = Setting::where('key', 'update_products')->first(); $productLogger = new ProductLogger($settingora, 'updateproducts', true); - + try { $productLogger->addLog('inserted', 'PRODOTTI INSERITI' . "\n"); $productLogger->addLog('not_inserted', 'EVENTUALI PRODOTTI NON INSERITI' . "\n"); @@ -85,10 +85,12 @@ class ProductUpdateGm extends Command ->where('data', '>=', $fromtime) ->where(function ($query) { $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') ->orWhere('DescrizioneStatoProdotto', 'In prevendita') ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); }) - //->where('DescrizioneTipologia','Video Streaming') + //->where('DescrizioneTipologia','Video Streaming') ->orderBy('Titolo') ->get(); diff --git a/app/Console/Commands/ProductUpdateISBN.php b/app/Console/Commands/ProductUpdateISBN.php index ced59334..f00221ec 100755 --- a/app/Console/Commands/ProductUpdateISBN.php +++ b/app/Console/Commands/ProductUpdateISBN.php @@ -82,6 +82,8 @@ class ProductUpdateISBN extends Command ->where('data', '>=', $fromtime) ->where(function ($query) { $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') ->orWhere('DescrizioneStatoProdotto', 'In prevendita') ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); }) diff --git a/app/Console/Commands/TestPao.php b/app/Console/Commands/TestPao.php index a2ffe33a..1add26a4 100755 --- a/app/Console/Commands/TestPao.php +++ b/app/Console/Commands/TestPao.php @@ -84,10 +84,12 @@ class TestPao extends Command ->where('data', '>=', $fromtime) ->where(function ($query) { $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') ->orWhere('DescrizioneStatoProdotto', 'In prevendita') ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); }) - //->where('DescrizioneTipologia','Video Streaming') + //->where('DescrizioneTipologia','Video Streaming') ->orderBy('Titolo') ->take(2) ->get(); @@ -207,7 +209,7 @@ class TestPao extends Command 'key' => 'DataPubblicazione', 'value' => $article->DataPubblicazione ], - + ] ]; if ($id == 0) { @@ -243,7 +245,7 @@ class TestPao extends Command $productLogger->addLog('info', " QtaDisp: " . $stock->QtaDisponibile); $productLogger->addLog('info', " DataOra: " . $stock->DataOra); - // Get the productsku record by $stock->Codice + // Get the productsku record by $stock->Codice $productsku = Product::where('sku', $stock->Codice)->first(); if ($productsku->count() > 0) { @@ -258,7 +260,7 @@ class TestPao extends Command echo "************** FINE *********** "; - // Select all the fields of the Stock table + // Select all the fields of the Stock table } catch (\Exception $e) { $productLogger->addLog('info', $e->getMessage()); @@ -268,7 +270,7 @@ class TestPao extends Command $productLogger->setLogandSendEmail('Test Paolo'); if (true) { - // Send the email + // Send the email Mail::raw($log, function ($message) { $message->to(Mylog::getEmail()); $message->subject(Mylog::getSubjectEmail("TESTPAO")); diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php index af09814a..79b371e0 100644 --- a/app/CustomFuncPao.php +++ b/app/CustomFuncPao.php @@ -2445,6 +2445,7 @@ function getArticoloById($idarticolo) //->where('T_WEB_Articoli.DataOra','>',$settingora->value) ->where(function ($query) { $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') ->orWhere('DescrizioneStatoProdotto', 'In prevendita') ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); }) @@ -2476,7 +2477,13 @@ function getArticoliCartolibro() ->leftJoin(DB::raw('(SELECT l.IdTipoFormato, l.Descrizione as DescrizioneFormato FROM T_WEB_TipiFormato l JOIN (SELECT IdTipoFormato, MAX(DataOra) as data1 from T_WEB_TipiFormato GROUP BY IdTipoFormato) m ON l.IdTipoFormato = m.IdTipoFormato AND l.DataOra = m.data1 ) n'), function ($join) { $join->on('T_WEB_Articoli.IdTipoFormato', '=', 'n.IdTipoFormato'); }) - ->where('DescrizioneStatoProdotto', 'In commercio') + ->where(function ($query) { + $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') + ->orWhere('DescrizioneStatoProdotto', 'In prevendita') + ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); + }) ->where('DescrizioneTipologia', 'Cartolibro') ->orderBy('Titolo') ->get(); @@ -2502,7 +2509,13 @@ function getArticoliRiviste() ->leftJoin(DB::raw('(SELECT l.IdTipoFormato, l.Descrizione as DescrizioneFormato FROM T_WEB_TipiFormato l JOIN (SELECT IdTipoFormato, MAX(DataOra) as data1 from T_WEB_TipiFormato GROUP BY IdTipoFormato) m ON l.IdTipoFormato = m.IdTipoFormato AND l.DataOra = m.data1 ) n'), function ($join) { $join->on('T_WEB_Articoli.IdTipoFormato', '=', 'n.IdTipoFormato'); }) - ->where('DescrizioneStatoProdotto', 'In commercio') + ->where(function ($query) { + $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') + ->orWhere('DescrizioneStatoProdotto', 'In prevendita') + ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); + }) ->where('DescrizioneTipologia', 'Rivista') ->orderBy('Titolo') ->get(); @@ -2541,6 +2554,8 @@ function updateArticoloFromGM($idarticolo) //->where('T_WEB_Articoli.DataOra','>',$settingora->value) ->where(function ($query) { $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') ->orWhere('DescrizioneStatoProdotto', 'In prevendita') ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); }) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index e12e08ec..aa04acc8 100755 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -285,7 +285,13 @@ class ArticleController extends Controller DB::raw('COALESCE(r.rank1Y, 0) as rank1Y'), DB::raw('s.ultimoOrdine') ) - ->where('DescrizioneStatoProdotto', 'In commercio') + ->where(function ($query) { + $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') + ->orWhere('DescrizioneStatoProdotto', 'In prevendita') + ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); + }) ->where('DescrizioneTipologia', 'Libri') ->orderBy('totVen', 'desc') ->get(); @@ -394,7 +400,13 @@ class ArticleController extends Controller DB::raw('COALESCE(r.rank1Y, 0) as rank1Y'), DB::raw('s.ultimoOrdine') ) - ->where('DescrizioneStatoProdotto', 'In commercio') + ->where(function ($query) { + $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') + ->orWhere('DescrizioneStatoProdotto', 'In prevendita') + ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); + }) ->where('DescrizioneTipologia', 'Libri') //->orderBy('rank1Y', 'asc') ->orderBy('totFat', 'desc') diff --git a/routes/web.php b/routes/web.php index 04d84ebf..3d318548 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3863,9 +3863,12 @@ Route::get('/updateproducts', function () { ->where('data', '>=', $fromtime) ->where(function ($query) { $query->where('DescrizioneStatoProdotto', 'In commercio') + ->orWhere('DescrizioneStatoProdotto', '2023 in commercio') + ->orWhere('DescrizioneStatoProdotto', 'Vendita sito') + ->orWhere('DescrizioneStatoProdotto', 'In prevendita') ->orWhere('DescrizioneStatoProdotto', 'Prossima uscita'); }) - //->where('DescrizioneTipologia','Video Streaming') + //->where('DescrizioneTipologia','Video Streaming') ->orderBy('Titolo') ->get(); ob_end_flush();