Aggiunto 'Rivista'
This commit is contained in:
@@ -986,6 +986,29 @@ function showCartolibri()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showRiviste()
|
||||||
|
{
|
||||||
|
$articles = getArticoliRiviste();
|
||||||
|
|
||||||
|
$sep = ' | ';
|
||||||
|
|
||||||
|
echo "PROVA:";
|
||||||
|
|
||||||
|
$ind = 1;
|
||||||
|
foreach ($articles as $article) {
|
||||||
|
|
||||||
|
if (true) {
|
||||||
|
// updateArticoloFromGM($article->IdArticolo);
|
||||||
|
}
|
||||||
|
|
||||||
|
$riga = getRigaArticoloByArt($article, $ind, $sep);
|
||||||
|
echo $riga;
|
||||||
|
|
||||||
|
|
||||||
|
$ind++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function libriInPrevendita()
|
function libriInPrevendita()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -1057,6 +1080,7 @@ function setProductFromGM($article, $initlog, ProductLogger &$passproductLogger)
|
|||||||
|
|
||||||
case 'Libri':
|
case 'Libri':
|
||||||
case 'Cartolibro':
|
case 'Cartolibro':
|
||||||
|
case 'Rivista':
|
||||||
|
|
||||||
$prodotti = $prodotti->where('name', $titolo)->get();
|
$prodotti = $prodotti->where('name', $titolo)->get();
|
||||||
$id = 0;
|
$id = 0;
|
||||||
@@ -2090,6 +2114,32 @@ function getArticoliCartolibro()
|
|||||||
return $articles;
|
return $articles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getArticoliRiviste()
|
||||||
|
{
|
||||||
|
$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')
|
||||||
|
->on('T_WEB_Articoli.DataOra', '=', 'b.data');
|
||||||
|
})
|
||||||
|
->leftJoin(DB::raw('(SELECT e.IdStatoProdotto, e.Descrizione as DescrizioneStatoProdotto FROM T_WEB_StatiProdotto e JOIN (SELECT IdStatoProdotto, MAX(DataOra) as data1 from T_WEB_StatiProdotto GROUP BY IdStatoProdotto) c ON e.IdStatoProdotto = c.IdStatoProdotto AND e.DataOra = c.data1 ) f'), function ($join) {
|
||||||
|
$join->on('T_WEB_Articoli.IdStatoProdotto', '=', 'f.IdStatoProdotto');
|
||||||
|
})
|
||||||
|
->leftJoin(DB::raw('(SELECT g.IdTipologia, g.Descrizione as DescrizioneTipologia FROM T_WEB_Tipologie g JOIN (SELECT IdTipologia, MAX(DataOra) as data1 from T_WEB_Tipologie GROUP BY IdTipologia) h ON g.IdTipologia = h.IdTipologia AND g.DataOra = h.data1 ) i'), function ($join) {
|
||||||
|
$join->on('T_WEB_Articoli.IdTipologia', '=', 'i.IdTipologia');
|
||||||
|
})
|
||||||
|
->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('DescrizioneTipologia', 'Rivista')
|
||||||
|
->orderBy('Titolo')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
|
||||||
|
echo "Trovati " . $articles->count() . " riviste <br>";
|
||||||
|
|
||||||
|
return $articles;
|
||||||
|
}
|
||||||
|
|
||||||
function updateArticoloFromGM($idarticolo)
|
function updateArticoloFromGM($idarticolo)
|
||||||
{
|
{
|
||||||
$productLogger = new ProductLogger(null, '');
|
$productLogger = new ProductLogger(null, '');
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
<button type="button" data-action="showTest">Test</button>
|
<button type="button" data-action="showTest">Test</button>
|
||||||
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
|
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
|
||||||
<button type="button" data-action="cartolibri">Cartolibri</button>
|
<button type="button" data-action="cartolibri">Cartolibri</button>
|
||||||
|
<button type="button" data-action="riviste">Riviste</button>
|
||||||
<button type="button" data-action="showOrdini">Mostra Ordini</button>
|
<button type="button" data-action="showOrdini">Mostra Ordini</button>
|
||||||
<button type="button" data-action="showOrdiniWeb">Mostra Ordini Web</button>
|
<button type="button" data-action="showOrdiniWeb">Mostra Ordini Web</button>
|
||||||
<button type="button" data-action="Vendite">Vendite</button>
|
<button type="button" data-action="Vendite">Vendite</button>
|
||||||
|
|||||||
@@ -2078,7 +2078,7 @@ Route::get('/artlibri', function () {
|
|||||||
$prodotti = null;
|
$prodotti = null;
|
||||||
$titolo = rtrim($titolo);
|
$titolo = rtrim($titolo);
|
||||||
|
|
||||||
echo $key . ' | ' . $article->idArticolo . ' | ' . $article->Ean13 . ' | ' . $article->Pagine . ' | '. $article->Titolo . ' | ' . $titolo . "<br>";
|
echo $key . ' | ' . $article->idArticolo . ' | ' . $article->Ean13 . ' | ' . $article->Pagine . ' | ' . $article->Titolo . ' | ' . $titolo . "<br>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2245,7 +2245,8 @@ Route::post('/updatecreate', function (Request $request) {
|
|||||||
$productLogger = new ProductLogger(null, 'neworders');
|
$productLogger = new ProductLogger(null, 'neworders');
|
||||||
$productLogger->addLog('', 'updatecreate: check se ARRIVATO ORDINE ' . $request->payment_method . ' ' . $request->status);
|
$productLogger->addLog('', 'updatecreate: check se ARRIVATO ORDINE ' . $request->payment_method . ' ' . $request->status);
|
||||||
|
|
||||||
if (($request->status == 'on-hold' && $request->payment_method == 'bacs') ||
|
if (
|
||||||
|
($request->status == 'on-hold' && $request->payment_method == 'bacs') ||
|
||||||
($request->status == 'processing' && $request->payment_method == 'wc_gateway_gestpay') ||
|
($request->status == 'processing' && $request->payment_method == 'wc_gateway_gestpay') ||
|
||||||
($request->status == 'processing' && $request->payment_method == 'paypal') ||
|
($request->status == 'processing' && $request->payment_method == 'paypal') ||
|
||||||
($request->status == 'processing' && $request->payment_method == 'test')
|
($request->status == 'processing' && $request->payment_method == 'test')
|
||||||
@@ -5081,12 +5082,6 @@ Route::get('/prossimauscita', function () {
|
|||||||
$productsku = Product::where('sku', $article->IdArticolo)->first();
|
$productsku = Product::where('sku', $article->IdArticolo)->first();
|
||||||
//if(Gm_product::where('id_gm',$article->IdArticolo)->doesntExist())
|
//if(Gm_product::where('id_gm',$article->IdArticolo)->doesntExist())
|
||||||
if ($productsku->count() == 0) {
|
if ($productsku->count() == 0) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$titolo = null;
|
$titolo = null;
|
||||||
$formato = null;
|
$formato = null;
|
||||||
$prodotti = null;
|
$prodotti = null;
|
||||||
@@ -5096,6 +5091,7 @@ Route::get('/prossimauscita', function () {
|
|||||||
|
|
||||||
case 'Libri':
|
case 'Libri':
|
||||||
case 'Cartolibro':
|
case 'Cartolibro':
|
||||||
|
case 'Rivista':
|
||||||
|
|
||||||
$prodotti = $prodotti->where('name', $titolo)->get();
|
$prodotti = $prodotti->where('name', $titolo)->get();
|
||||||
$id = 0;
|
$id = 0;
|
||||||
@@ -6426,6 +6422,8 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
|
|||||||
return libriInPrevendita();
|
return libriInPrevendita();
|
||||||
} elseif ($action == 'cartolibri') {
|
} elseif ($action == 'cartolibri') {
|
||||||
return showCartolibri();
|
return showCartolibri();
|
||||||
|
} elseif ($action == 'riviste') {
|
||||||
|
return showRiviste();
|
||||||
} elseif ($action == 'showOrdini') {
|
} elseif ($action == 'showOrdini') {
|
||||||
return showOrdini();
|
return showOrdini();
|
||||||
} elseif ($action == 'showTest') {
|
} elseif ($action == 'showTest') {
|
||||||
|
|||||||
Reference in New Issue
Block a user