From e99982032c54bd2980b2d03c3b0480af3cfdb490 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Tue, 18 Jun 2024 12:33:54 +0300 Subject: [PATCH] =?utf8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=B4=D0=B5?= =?utf8?q?=D0=B1=D0=B0=D0=B3=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80=D0=BC=D0=B0?= =?utf8?q?=D1=86=D0=B8=D1=8E,=20=D0=BB=D0=B8=D1=88=D0=BD=D1=8E=D1=8E=20?= =?utf8?q?=D1=81=D0=BA=D0=BE=D0=B1=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/modul/shipment/fields/sales_7day_division.php | 2 +- erp24/modul/shipment/functionsShipment.php | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/erp24/modul/shipment/fields/sales_7day_division.php b/erp24/modul/shipment/fields/sales_7day_division.php index 75d5eaa3..fd5c589f 100644 --- a/erp24/modul/shipment/fields/sales_7day_division.php +++ b/erp24/modul/shipment/fields/sales_7day_division.php @@ -25,7 +25,7 @@ foreach($productGroupArray as $group =>$pArray) { WHERE s.id=i.check_id AND i.product_id in($whereInProductsId_in) AND s.store_id_1c $orderStoresArrayRelation_in AND s.date<='$date_start_division 00:00:00' - AND s.date>='$date_start_division'::date -interval '$day_sales day' group BY i.product_id, s.store_id_1c, s.operation "); + AND s.date>='$date_start_division'::date -interval '$day_sales day' group BY i.product_id, s.store_id_1c, s.operation "; $data2 = $db::getRows($sql); foreach ($data2 as $row2) { diff --git a/erp24/modul/shipment/functionsShipment.php b/erp24/modul/shipment/functionsShipment.php index facf7118..6bf0818d 100644 --- a/erp24/modul/shipment/functionsShipment.php +++ b/erp24/modul/shipment/functionsShipment.php @@ -732,7 +732,6 @@ function insert_store_orders_fields($massivSQL,$field_name,$massivTitle=[], $pri } foreach($massivSQL as $productId =>$array) { -// echo "PRODUCTID: " . $productId . " ||| "; foreach($array as $storeId =>$valueArr) { foreach($valueArr as $color =>$value) { // if(empty($color) or $storeId=="NULL") $color=""; @@ -769,10 +768,8 @@ function insert_store_orders_fields($massivSQL,$field_name,$massivTitle=[], $pri if($Insert) { $sql = "INSERT INTO store_orders_fields_data (product_id, order_id, store_id, field_name, field_id, value, value_text, color,hand,date_update, title) VALUES (?,?,?,?,?,?,?,?,'-1',NOW(),?) ON CONFLICT (order_id, product_id, store_id, field_id, field_name, color) DO UPDATE SET value=?, hand=0, value_text=?, date_update=NOW(), title=?"; - //$sql2 = "INSERT INTO store_orders_fields_data (product_id, order_id, store_id, field_name, field_id, value, value_text, color,hand,date_update, title) - //VALUES ('$productId','$orderId','$storeId','$field_name','$field_id','$value','$value_text','$color','-1',NOW(),'$title') ON CONFLICT (order_id, product_id, store_id, field_id, field_name, color) DO UPDATE SET value='$value', hand=0, value_text='$value_text', date_update=NOW(), title='$title'"; -// var_dump($value); var_dump($field_name); -// var_dump([$productId, $orderId, $storeId, $field_name, $field_id, $value, $value_text, $color, $title, $value, $value_text, $title]); + $sql2 = "INSERT INTO store_orders_fields_data (product_id, order_id, store_id, field_name, field_id, value, value_text, color,hand,date_update, title) + VALUES ('$productId','$orderId','$storeId','$field_name','$field_id','$value','$value_text','$color','-1',NOW(),'$title') ON CONFLICT (order_id, product_id, store_id, field_id, field_name, color) DO UPDATE SET value='$value', hand=0, value_text='$value_text', date_update=NOW(), title='$title'"; $db::sql($sql, [$productId, $orderId, $storeId, $field_name, $field_id, $value, $value_text, $color, $title, $value, $value_text, $title]); } } -- 2.39.5