This commit is contained in:
paoloar77
2024-05-21 00:42:31 +02:00
parent 4e3184c0f1
commit f1fd2e51fe
2 changed files with 8 additions and 19 deletions

View File

@@ -12,7 +12,8 @@
<input type="text" id="article_id" name="id" />
<br>
<button type="button" data-action="search">Cerca Articolo</button>
<button type="button" data-action="checkPrevendita">E' in PreVendita?</button>
<button type="button" data-action="checkPrevendita">E' in PreVendita?</button><br>
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
</form>
<div id="result"></div>

View File

@@ -6120,12 +6120,8 @@ Route::get('/paolibri', function () {
//->where(function($query){
//->where('DescrizioneStatoProdotto','Usato')
->where(function ($query) {
$query->where('DescrizioneStatoProdotto', 'In commercio')
->orWhere('DescrizioneStatoProdotto', 'In prevendita')
->orWhere('DescrizioneStatoProdotto', 'Prossima uscita');
$query->where('DescrizioneStatoProdotto', 'In prevendita');
})
//->orWhere('DescrizioneStatoProdotto','Remainder');
//})
->where(DB::raw('CONVERT(INT, QtaDisponibile)'), '>', 0)
->where('DescrizioneFormato', 'brossura')
->where('DescrizioneTipologia', 'Libri')
@@ -6146,7 +6142,7 @@ Route::get('/paolibri', function () {
}
});
Route::get('/qtanegativa', function () {
Route::get('/inprevendita', function () {
set_time_limit(0);
$articles = Article::join(DB::raw('(SELECT IdArticolo, MAX(DataOra) AS data FROM T_WEB_Articoli GROUP BY IdArticolo) b'), function ($join) {
@@ -6167,21 +6163,11 @@ Route::get('/qtanegativa', function () {
$join->on('T_WEB_Articoli.IdArticolo', '=', 'q.Codice');
})
// ->where('DescrizioneStatoProdotto', 'usato')
//->where(function($query){
//->where('DescrizioneStatoProdotto','Usato')
->where(function ($query) {
$query->where('DescrizioneStatoProdotto', 'In commercio')
->orWhere('DescrizioneStatoProdotto', 'In prevendita')
->orWhere('DescrizioneStatoProdotto', 'Prossima uscita');
})
//->orWhere('DescrizioneStatoProdotto','Remainder');
//})
->where('DescrizioneStatoProdotto', 'In prevendita')
->where(DB::raw('CONVERT(INT, QtaDisponibile)'), '<', 0)
->where('DescrizioneFormato', 'brossura')
->where('DescrizioneTipologia', 'Libri')
->orderBy('DataPubblicazione', 'desc')
->limit(20)
->get();
$sep = ' | ';
@@ -6211,7 +6197,7 @@ Route::get('/qtanegativa', function () {
$ind++;
}
})->name('qtanegativa');
})->name('inprevendita');
Route::get('/mylinkspao', function () {
return view('mylinkspao');
@@ -6222,6 +6208,8 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
if ($action == 'search') {
// Logica di ricerca dell'articolo
return loadArticleByIdArticle($id);
} elseif ($action == 'inprevendita') {
return route('inprevendita');
} elseif ($action == 'checkPrevendita') {
// Logica per verificare se l'articolo è in preordine
$inprevendita = isArticleInPrevendita($id);