aaa
This commit is contained in:
@@ -527,20 +527,24 @@ function setOrdine($idinternet, $mode)
|
||||
{
|
||||
try {
|
||||
$str = "setOrdine";
|
||||
$ordine = Orderdetail::where('IdInternet', $idinternet)->get();
|
||||
$ordini = Orderdetail::where('IdInternet', $idinternet)->get();
|
||||
|
||||
if ($ordine)
|
||||
$str .= getarraystr($ordine) . "<br>";
|
||||
if (!$ordini->isEmpty()) {
|
||||
$ordine = $ordini[0];
|
||||
|
||||
$prodotto = Product::where('sku', $ordine["CodArticoloGM"])->first();
|
||||
if ($ordine)
|
||||
$str .= getarraystr($ordine) . "<br>";
|
||||
|
||||
if ($prodotto)
|
||||
$str .= getarraystr($prodotto) . "<br>";
|
||||
$prodotto = Product::where('sku', $ordine["CodArticoloGM"])->first();
|
||||
|
||||
if ($mode === 'AAAdel' && $ordine) {
|
||||
// delete record $ordine
|
||||
$deletedCount = Orderdetail::where('IdInternet', $idinternet)->delete();
|
||||
$str .= "<br><span style='color: red;'>Numero di record eliminati: " . $deletedCount . "</span>";
|
||||
if ($prodotto)
|
||||
$str .= getarraystr($prodotto) . "<br>";
|
||||
|
||||
if ($mode === 'AAAdel' && $ordine) {
|
||||
// delete record $ordine
|
||||
$deletedCount = Orderdetail::where('IdInternet', $idinternet)->delete();
|
||||
$str .= "<br><span style='color: red;'>Numero di record eliminati: " . $deletedCount . "</span>";
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$str .= "Errore: " . $e->getMessage();
|
||||
|
||||
Reference in New Issue
Block a user