ordini
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Article;
|
||||
use Codexshaper\WooCommerce\Facades\Order;
|
||||
use Codexshaper\WooCommerce\Facades\Product;
|
||||
use Codexshaper\WooCommerce\Facades\Variation;
|
||||
|
||||
@@ -236,6 +237,24 @@ function loadArticleByIdArticle($id, $checkprevendita = false)
|
||||
}
|
||||
}
|
||||
|
||||
function showOrdini()
|
||||
{
|
||||
$orders = Order::all();
|
||||
|
||||
$str = "";
|
||||
|
||||
// Show the fields of the orders
|
||||
foreach ($orders as $order) {
|
||||
$str .= "Ordine: ";
|
||||
$str .= getvalstr("Id", $order->id);
|
||||
$str .= getvalstr("DataOra", $order->DataOra);
|
||||
$str .= getvalstr("Totale", $order->Totale);
|
||||
}
|
||||
|
||||
return $str;
|
||||
|
||||
}
|
||||
|
||||
function libriInPrevendita()
|
||||
{
|
||||
try {
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<br><br>
|
||||
|
||||
<button type="button" data-action="inprevendita">Libri in Prevendita</button>
|
||||
<button type="button" data-action="showOrdini">Mostra Ordini</button>
|
||||
</form>
|
||||
<div id="result"></div>
|
||||
<div id="loading"></div>
|
||||
|
||||
@@ -1865,19 +1865,6 @@ function getvalstr($mystr, $value) {
|
||||
|
||||
}
|
||||
|
||||
Route::get('/test6', function () {
|
||||
$orders = Order::all();
|
||||
|
||||
// Show the fields of the orders
|
||||
foreach ($orders as $order) {
|
||||
echo "Ordine: ";
|
||||
getvalstr("Id", $order->id);
|
||||
getvalstr("DataOra", $order->DataOra);
|
||||
getvalstr("Totale", $order->Totale);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
Route::get('/test7/{name}', function ($name) {
|
||||
$articles = Article::join(DB::raw('(SELECT IdArticolo, MAX(DataOra) AS data FROM T_WEB_Articoli WHERE Titolo LIKE \'%' . $name . '%\' GROUP BY IdArticolo) b'), function ($join) {
|
||||
@@ -6169,6 +6156,8 @@ Route::get('/handle-article-action-pao/{id}/{action}', function ($id, $action) {
|
||||
return loadArticleByIdArticle($id);
|
||||
} elseif ($action == 'inprevendita') {
|
||||
return libriInPrevendita();
|
||||
} elseif ($action == 'showOrdini') {
|
||||
return showOrdini();
|
||||
|
||||
} elseif ($action == 'setPreOrder') {
|
||||
setPreOrder($id, "1", true);
|
||||
|
||||
Reference in New Issue
Block a user