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