From ff40205196990f7198eef534bbd95282cea494a3 Mon Sep 17 00:00:00 2001 From: marina Date: Sat, 27 Apr 2024 17:35:07 +0300 Subject: [PATCH] =?utf8?q?insert=20ignore=20c=20mysql=20=D0=BF=D0=B5=D1=80?= =?utf8?q?=D0=B5=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD=20postgresql=20=D0=BF=D1=80?= =?utf8?q?=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/modul/shipment/functionsShipment.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/erp24/modul/shipment/functionsShipment.php b/erp24/modul/shipment/functionsShipment.php index 0c6e7a0..fb5e842 100644 --- a/erp24/modul/shipment/functionsShipment.php +++ b/erp24/modul/shipment/functionsShipment.php @@ -428,8 +428,15 @@ $status_store=""; if(!empty($store_id)) { if(!empty($_GET["status"]) and !empty($store_id) and !empty($orderId)) { -$db::sql("INSERT IGNORE INTO store_order_status SET order_id=?, store_id=?, status_id=?, status=?, date=NOW(), admin_id=? ", -[$orderId,$store_id,$status_order_id,1,$_SESSION["admin_id"]]); + $db::sql("INSERT INTO store_order_status_log (order_id, store_id, status_id, status, date, admin_id) + VALUES ('$orderId', '$store_id', $status_order_id, 1, NOW(), " . $_SESSION["admin_id"] . ") + ON CONFLICT (id) DO UPDATE SET + order_id = '$orderId', + store_id = '$store_id', + status_id = $status_order_id, + status = 1, + date = NOW(), + admin_id = " . $_SESSION["admin_id"]); } $store_order_status_value=$db::getValue("SELECT status FROM store_order_status WHERE order_id=? AND store_id=? AND status_id=?",[$orderId,$store_id,$status_order_id]); -- 2.39.5