From: Alexander Smirnov Date: Thu, 23 May 2024 11:03:19 +0000 (+0300) Subject: fix part 021 remove debug info X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=65b1080e5a2933a7a0df42cce40077ee3da230aa;p=yii-erp24%2F.git fix part 021 remove debug info --- diff --git a/erp24/modul/shipment/fields/auto_purchase_formula_all.php b/erp24/modul/shipment/fields/auto_purchase_formula_all.php index 237f941..e248841 100644 --- a/erp24/modul/shipment/fields/auto_purchase_formula_all.php +++ b/erp24/modul/shipment/fields/auto_purchase_formula_all.php @@ -6,7 +6,7 @@ global $orderId, $orderStoresArrayRelation_in, $data_up; field_name='auto_purchase_formula' AND value>0 AND store_id $orderStoresArrayRelation_in AND order_id='$orderId' AND color='' AND store_id!='' group by product_id"; -// var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { $data_up[$row["product_id"]][0][0] = ($data_up[$row["product_id"]][0][0] ?? 0) + (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/cost_price_auto.php b/erp24/modul/shipment/fields/cost_price_auto.php index a93bf91..0d4d99d 100644 --- a/erp24/modul/shipment/fields/cost_price_auto.php +++ b/erp24/modul/shipment/fields/cost_price_auto.php @@ -6,7 +6,7 @@ field_name='purchase_logistic' AND value>0 AND store_id $orderStoresArrayRelation_in AND order_id='$orderId' AND store_id='' group by color"; -// var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { if(empty($row["color"])) $row["color"]=0; diff --git a/erp24/modul/shipment/fields/cost_price_summ.php b/erp24/modul/shipment/fields/cost_price_summ.php index b8d9a01..f0a9b87 100644 --- a/erp24/modul/shipment/fields/cost_price_summ.php +++ b/erp24/modul/shipment/fields/cost_price_summ.php @@ -10,7 +10,7 @@ order_id=? AND store_id='' AND field_name IN ('quantity_zakup_fact') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray["quantity_zakup_fact"][$row["product_id"]][0][$row["color"]] += (int)$row["value"]; @@ -22,7 +22,7 @@ order_id=? AND store_id='' AND field_name IN ('cost_price') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql,[$orderId]); foreach($dataF as $row) { $FiledsDataArray["cost_price"][$row["product_id"]][0][$row["color"]] = round($row["value"],2); diff --git a/erp24/modul/shipment/fields/delta_sales4week_supplier.php b/erp24/modul/shipment/fields/delta_sales4week_supplier.php index 25cb009..d099544 100644 --- a/erp24/modul/shipment/fields/delta_sales4week_supplier.php +++ b/erp24/modul/shipment/fields/delta_sales4week_supplier.php @@ -8,7 +8,7 @@ $sql = "SELECT product_id, store_id, sum(CASE WHEN field_name='sales_4weeks_cnt' THEN value ELSE 0 END) as sales_4weeks_cnt FROM store_orders_fields_data WHERE field_name in('quantity_zakup_new','sales_4weeks_cnt') AND value>0 AND order_id='$orderId' AND color='' AND store_id!='' group by product_id,store_id"; -//var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { if($row["sales_4weeks_cnt"]>0) { diff --git a/erp24/modul/shipment/fields/delta_sales7_and_supplier.php b/erp24/modul/shipment/fields/delta_sales7_and_supplier.php index 029ec74..a4e18a2 100644 --- a/erp24/modul/shipment/fields/delta_sales7_and_supplier.php +++ b/erp24/modul/shipment/fields/delta_sales7_and_supplier.php @@ -7,7 +7,7 @@ global $orderId, $data_up; sum(CASE WHEN field_name='sales_cnt' THEN value ELSE 0 END) as sales_cnt FROM store_orders_fields_data WHERE field_name in('quantity_zakup_new','sales_cnt') AND value>0 AND order_id='$orderId' AND color='' AND store_id!='' group by product_id,store_id"; -//var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { diff --git a/erp24/modul/shipment/fields/delta_zakup.php b/erp24/modul/shipment/fields/delta_zakup.php index 564c5f0..d4a196c 100644 --- a/erp24/modul/shipment/fields/delta_zakup.php +++ b/erp24/modul/shipment/fields/delta_zakup.php @@ -10,7 +10,7 @@ AND color='' AND store_id='', AND field_name IN ('quantity_zakup_fact','quantity_zakup') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql,[$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]] = (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/division_auto.php b/erp24/modul/shipment/fields/division_auto.php index 0d0b825..c611739 100644 --- a/erp24/modul/shipment/fields/division_auto.php +++ b/erp24/modul/shipment/fields/division_auto.php @@ -17,7 +17,7 @@ function ceilCoef($number, $rate = 1) $min_lot=[]; $sql = "SELECT id,min_lot FROM products_1c_options WHERE id $whereInProductsId"; -//var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { $min_lot[$row["id"]] = $row["min_lot"]; @@ -35,7 +35,7 @@ AND field_name IN ('division_auto_need') AND color='' AND store_id!='' "; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]][$row["store_id"]] = (int)$row["value"]; @@ -49,7 +49,7 @@ AND store_id $orderStoresArrayRelation_in AND field_name IN ( 'division_ratio') AND store_id='' AND color='' AND value!='0'"; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]] = $row["value"]; diff --git a/erp24/modul/shipment/fields/division_auto_all.php b/erp24/modul/shipment/fields/division_auto_all.php index 2d77af6..4e5eaf8 100644 --- a/erp24/modul/shipment/fields/division_auto_all.php +++ b/erp24/modul/shipment/fields/division_auto_all.php @@ -6,7 +6,7 @@ $sql = "SELECT product_id,sum(value) as value,color FROM store_orders_fields_dat field_name='division_auto' AND value>0 AND store_id $orderStoresArrayRelation_in AND order_id='$orderId' AND store_id!='' group by product_id, color"; -//var_dump($sql); die; + $data = $db::getRows($sql); foreach($data as $row) { diff --git a/erp24/modul/shipment/fields/division_auto_need.php b/erp24/modul/shipment/fields/division_auto_need.php index cc597be..4615c70 100644 --- a/erp24/modul/shipment/fields/division_auto_need.php +++ b/erp24/modul/shipment/fields/division_auto_need.php @@ -19,7 +19,7 @@ FROM store_orders_fields_data WHERE order_id=? AND color='' AND field_name IN ('entrance_cnt_7days','sales_cnt','quantity','quantity_fact','min_lot','min_order') "; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]][$row["store_id"]] = (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/division_auto_need_all.php b/erp24/modul/shipment/fields/division_auto_need_all.php index a0c61c5..b4e0c60 100644 --- a/erp24/modul/shipment/fields/division_auto_need_all.php +++ b/erp24/modul/shipment/fields/division_auto_need_all.php @@ -6,7 +6,7 @@ $sql = "SELECT product_id,sum(value) as value,color FROM store_orders_fields_dat field_name='division_auto_need' AND value>0 AND store_id $orderStoresArrayRelation_in AND order_id='$orderId' AND store_id!='' group by product_id, color"; -// var_dump($sql); die; + $data = $db::getRows($sql); foreach($data as $row) { if (empty($row["color"])) { diff --git a/erp24/modul/shipment/fields/division_hand.php b/erp24/modul/shipment/fields/division_hand.php index c3e46d4..d1b50bf 100644 --- a/erp24/modul/shipment/fields/division_hand.php +++ b/erp24/modul/shipment/fields/division_hand.php @@ -6,7 +6,7 @@ $sql = "SELECT product_id,sum(value) as value,color FROM store_orders_fields_dat field_name='division_hand' AND value>0 AND store_id $orderStoresArrayRelation_in AND order_id='$orderId' AND store_id!='' group by product_id, store_id,color"; -//var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { if(empty($row["color"])) { diff --git a/erp24/modul/shipment/fields/division_price_summ.php b/erp24/modul/shipment/fields/division_price_summ.php index 35e846f..712a206 100644 --- a/erp24/modul/shipment/fields/division_price_summ.php +++ b/erp24/modul/shipment/fields/division_price_summ.php @@ -11,7 +11,7 @@ AND color='' AND store_id='' AND field_name IN ('purchase_price') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $prices[$row["product_id"]] = $row["value"]; @@ -26,7 +26,7 @@ AND color='' AND store_id!='' AND field_name IN ('division_summ') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]][$row["store_id"]] = $row["value"]; diff --git a/erp24/modul/shipment/fields/division_ratio.php b/erp24/modul/shipment/fields/division_ratio.php index f1f193b..f580106 100644 --- a/erp24/modul/shipment/fields/division_ratio.php +++ b/erp24/modul/shipment/fields/division_ratio.php @@ -9,7 +9,7 @@ order_id=? AND store_id='' AND field_name IN ('division_auto_need_all','quantity_warehouseman_fact') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { if (empty($row["color"])) { diff --git a/erp24/modul/shipment/fields/division_store.php b/erp24/modul/shipment/fields/division_store.php index 9a875af..8e9731c 100644 --- a/erp24/modul/shipment/fields/division_store.php +++ b/erp24/modul/shipment/fields/division_store.php @@ -16,7 +16,7 @@ order_id=? AND store_id='' AND field_name IN ('division_store_ratio','min_lot') AND value!=0 group by field_name, product_id, store_id, value,color "; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { if (empty($row["color"])) { @@ -44,7 +44,7 @@ AND store_id $orderStoresArrayRelation_in AND store_id!='' AND field_name IN ('quantity_zakup_new') AND value!=0 "; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql, [$orderId]); foreach($dataF as $row) { if (empty($row["color"])) { diff --git a/erp24/modul/shipment/fields/division_store_hand.php b/erp24/modul/shipment/fields/division_store_hand.php index 170cf52..02c90c1 100644 --- a/erp24/modul/shipment/fields/division_store_hand.php +++ b/erp24/modul/shipment/fields/division_store_hand.php @@ -7,7 +7,7 @@ $sql = "SELECT product_id,sum(value) as value FROM store_orders_fields_data WHER AND store_id $orderStoresArrayRelation_in AND color='' AND order_id=? AND store_id!='' group by product_id"; -//var_dump($sql); var_dump($orderId); die; + $data = $db::getRows($sql, [$orderId]); foreach($data as $row) { $data_up[$row["product_id"]][0][0] = ($data_up[$row["product_id"]][0][0] ?? 0) + (int)$row["value"]; @@ -19,7 +19,7 @@ $sql = "SELECT product_id,sum(value) as value, color FROM store_orders_fields_da AND store_id $orderStoresArrayRelation_in AND color!='' AND order_id=? AND store_id!='' group by product_id,color"; -//var_dump($sql); var_dump($orderId); die; + $data = $db::getRows($sql, [$orderId]); foreach($data as $row) { $data_up[$row["product_id"]][0][$row["color"]] = ($data_up[$row["product_id"]][0][$row["color"]] ?? 0) + (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/division_store_ratio.php b/erp24/modul/shipment/fields/division_store_ratio.php index d0778b1..ec1139e 100644 --- a/erp24/modul/shipment/fields/division_store_ratio.php +++ b/erp24/modul/shipment/fields/division_store_ratio.php @@ -10,7 +10,7 @@ order_id=? AND store_id='' AND field_name IN ('quantity_warehouseman_fact') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { if (empty($row["color"])) { @@ -26,7 +26,7 @@ $sql = "SELECT product_id, value,color FROM store_orders_fields_data WHERE AND store_id $orderStoresArrayRelation_in AND order_id='$orderId' AND store_id!=''"; -//var_dump($sql); + $data=$db::getRows($sql); foreach($data as $row) { if (empty($row["color"])) { diff --git a/erp24/modul/shipment/fields/division_store_summ.php b/erp24/modul/shipment/fields/division_store_summ.php index c7b80e9..46a5f1c 100644 --- a/erp24/modul/shipment/fields/division_store_summ.php +++ b/erp24/modul/shipment/fields/division_store_summ.php @@ -12,7 +12,7 @@ AND store_id!='' AND color!='' AND field_name IN ('division_store','division_store_hand') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { // if(empty($row["color"])) $row["color"]=0; @@ -51,7 +51,7 @@ AND store_id!='' AND color='' AND field_name IN ('division_store','division_store_hand') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]][$row["store_id"]][0] = ($FiledsDataArray[$row["field_name"]][$row["product_id"]][$row["store_id"]][0] ?? 0) + (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/division_summ.php b/erp24/modul/shipment/fields/division_summ.php index 8e2683c..b3f8766 100644 --- a/erp24/modul/shipment/fields/division_summ.php +++ b/erp24/modul/shipment/fields/division_summ.php @@ -11,7 +11,7 @@ AND color='' AND store_id!='' AND field_name IN ('division_auto','division_hand') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]][$row["store_id"]] = (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/division_summ_all.php b/erp24/modul/shipment/fields/division_summ_all.php index a084c91..a75bd2e 100644 --- a/erp24/modul/shipment/fields/division_summ_all.php +++ b/erp24/modul/shipment/fields/division_summ_all.php @@ -7,7 +7,7 @@ $sql = "SELECT product_id,sum(value) as value,color FROM store_orders_fields_dat AND store_id $orderStoresArrayRelation_in AND order_id='$orderId' AND store_id!='' group by product_id, color"; -//var_dump($sql); die; + $data = $db::getRows($sql); foreach($data as $row) { if (empty($row["color"])) { diff --git a/erp24/modul/shipment/fields/entrance_cnt_7days.php b/erp24/modul/shipment/fields/entrance_cnt_7days.php index 4203c0b..b8075a2 100644 --- a/erp24/modul/shipment/fields/entrance_cnt_7days.php +++ b/erp24/modul/shipment/fields/entrance_cnt_7days.php @@ -9,7 +9,7 @@ global $date_start_sale, $whereInProductsId, $data_up; if (!empty($date_start_sale)) { $sql = "SELECT id FROM store_orders WHERE status>=6 AND date_start <='$date_start_sale' AND date_start>='$date_start_sale'::date -interval '7 day'"; -// var_dump($sql); die; + $data = $db::getRows($sql); $whereInOrderId = ""; $i = 0; @@ -23,7 +23,7 @@ if (!empty($date_start_sale)) { if(!empty($whereInOrderId)) { $sql = "SELECT product_id, store_id, value FROM store_orders_fields_data WHERE order_id IN ($whereInOrderId) AND product_id $whereInProductsId AND field_name='division_summ' AND color='' AND value>0 group by product_id, store_id, value"; -// var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { $data_up[$row["product_id"]][$row["store_id"]]["0"] = $row["value"]; diff --git a/erp24/modul/shipment/fields/goods_in_transit.php b/erp24/modul/shipment/fields/goods_in_transit.php index 8066d6a..047059d 100644 --- a/erp24/modul/shipment/fields/goods_in_transit.php +++ b/erp24/modul/shipment/fields/goods_in_transit.php @@ -5,7 +5,7 @@ global $orderId, $data_up, $order_date_add; if(!empty($order_date_add) && $order_date_add!='000-00-00') { $sql = "SELECT id FROM store_orders WHERE date_add<='$order_date_add' AND date_add>='$order_date_add' - interval 7 day"; - //var_dump($sql); die; + $dataOrders2 = $db::getRows($sql); //echo"Товар в пути участвуют заказы:"; @@ -26,7 +26,7 @@ if(!empty($order_date_add) && $order_date_add!='000-00-00') { FROM store_orders_fields_data WHERE field_name='quantity_zakup_fact' AND value>0 $w_orders group by product_id,color"; -// var_dump($sql); die; + $data2=$db::getRows($sql); foreach($data2 as $row2) { diff --git a/erp24/modul/shipment/fields/min_lot.php b/erp24/modul/shipment/fields/min_lot.php index 7d1fd42..f0375b6 100644 --- a/erp24/modul/shipment/fields/min_lot.php +++ b/erp24/modul/shipment/fields/min_lot.php @@ -5,7 +5,7 @@ global $whereInProductsId, $data_up; if ($whereInProductsId != " in ()") { $sql = "SELECT id,min_lot FROM products_1c_options WHERE id $whereInProductsId"; -// var_dump($sql); die; + $data = $db::getRows($sql); foreach ($data as $row) { $data_up[$row["id"]][0][0] = $row["min_lot"]; diff --git a/erp24/modul/shipment/fields/min_order.php b/erp24/modul/shipment/fields/min_order.php index c2142fb..6e30bc1 100644 --- a/erp24/modul/shipment/fields/min_order.php +++ b/erp24/modul/shipment/fields/min_order.php @@ -4,7 +4,7 @@ global $whereInProductsId, $data_up; if ($whereInProductsId != " in ()") { $sql = "SELECT id,min_order FROM products_1c_options WHERE id $whereInProductsId"; -// var_dump($sql); die; + $data = $db::getRows($sql); foreach ($data as $row) { $data_up[$row["id"]][0][0] = $row["min_order"]; diff --git a/erp24/modul/shipment/fields/order_supplier_sum.php b/erp24/modul/shipment/fields/order_supplier_sum.php index 70986ff..38de62f 100644 --- a/erp24/modul/shipment/fields/order_supplier_sum.php +++ b/erp24/modul/shipment/fields/order_supplier_sum.php @@ -4,7 +4,7 @@ global $orderId, $data_up; $prices=[]; $sql = "SELECT product_id, value FROM store_orders_fields_data WHERE field_name='purchase_price' AND value>0 AND order_id=" . ($orderId ?? 0). " AND store_id='' AND color='' group by product_id, value"; -// var_dump($sql); die; + $data = $db::getRows($sql); foreach($data as $row) { $prices[$row["product_id"]] = $row["value"]; @@ -12,7 +12,7 @@ foreach($data as $row) { $sql = "SELECT product_id,sum(value) as value, store_id FROM store_orders_fields_data WHERE field_name='quantity_zakup_new' AND value>0 AND order_id=" . ($orderId ?? 0) . " AND color='' AND store_id!='' group by product_id,store_id"; -// var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { $s = intval(($row["value"] ?? 0) * ($prices[$row["product_id"]] ?? 0)); diff --git a/erp24/modul/shipment/fields/price_zakup_summ.php b/erp24/modul/shipment/fields/price_zakup_summ.php index 49cf628..6233380 100644 --- a/erp24/modul/shipment/fields/price_zakup_summ.php +++ b/erp24/modul/shipment/fields/price_zakup_summ.php @@ -7,7 +7,7 @@ $sql = "SELECT field_name, product_id, value FROM store_orders_fields_data WHERE order_id=? AND color='' AND store_id='' AND field_name IN ('purchase_price_zakup','quantity_zakup_fact')"; -//var_dump($sql); var_dump($orderId); die; + $dataF=$db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]] = $row["value"]; diff --git a/erp24/modul/shipment/fields/purchase_fact_difference.php b/erp24/modul/shipment/fields/purchase_fact_difference.php index 23494c8..da41cc2 100644 --- a/erp24/modul/shipment/fields/purchase_fact_difference.php +++ b/erp24/modul/shipment/fields/purchase_fact_difference.php @@ -10,7 +10,7 @@ AND color='' AND store_id='' AND field_name IN ('quantity_warehouseman_fact','quantity_zakup_fact') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]] = (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/purchase_price.php b/erp24/modul/shipment/fields/purchase_price.php index 3bca480..3652f11 100644 --- a/erp24/modul/shipment/fields/purchase_price.php +++ b/erp24/modul/shipment/fields/purchase_price.php @@ -4,7 +4,7 @@ global $whereInProductsId, $data_up; if ($whereInProductsId != " in ()") { $sql = "SELECT product_id, price FROM prices WHERE product_id $whereInProductsId"; -// var_dump($sql); die; + $data = $db::getRows($sql); foreach ($data as $row) { diff --git a/erp24/modul/shipment/fields/purchase_summ.php b/erp24/modul/shipment/fields/purchase_summ.php index 85f7257..ee288c7 100644 --- a/erp24/modul/shipment/fields/purchase_summ.php +++ b/erp24/modul/shipment/fields/purchase_summ.php @@ -7,7 +7,7 @@ $sql = "SELECT field_name, product_id, value FROM store_orders_fields_data WHERE order_id=? AND color='' AND store_id='' AND field_name IN ('purchase_price','quantity_zakup_fact')"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]] = $row["value"]; diff --git a/erp24/modul/shipment/fields/quantity.php b/erp24/modul/shipment/fields/quantity.php index e6e7267..3e67107 100644 --- a/erp24/modul/shipment/fields/quantity.php +++ b/erp24/modul/shipment/fields/quantity.php @@ -7,7 +7,7 @@ if ($whereInProductsId != " in ()") { FROM store_planogram WHERE quantity>0 AND product_id $whereInProductsId AND store_id $orderStoresArrayRelation_in group by product_id, color, store_id, quantity"; -// var_dump($sql); die; + $store_planogram = $db::getRows($sql); foreach ($store_planogram as $row) { diff --git a/erp24/modul/shipment/fields/quantity_fact.php b/erp24/modul/shipment/fields/quantity_fact.php index b2c41f7..a770e00 100644 --- a/erp24/modul/shipment/fields/quantity_fact.php +++ b/erp24/modul/shipment/fields/quantity_fact.php @@ -3,7 +3,7 @@ global $orderStoresArrayRelation_in, $whereInProductsId, $data_up; $sql = "SELECT date_id FROM store_products_fact order by date_id DESC LIMIT 1"; -//var_dump($sql); die; + $date_id = $db::getValue($sql); if ($whereInProductsId != " in ()") { @@ -11,7 +11,7 @@ if ($whereInProductsId != " in ()") { AND date_id=? AND store_id $orderStoresArrayRelation_in AND product_id $whereInProductsId"; -// var_dump($sql); var_dump($date_id); die; + $store_products_fact = $db::getRows($sql, [$date_id]); foreach ($store_products_fact as $row) { $data_up[$row["product_id"]][$row["store_id"]][$row["color"]] = ($data_up[$row["product_id"]][$row["store_id"]][$row["color"]] ?? 0) + $row["quantity"]; diff --git a/erp24/modul/shipment/fields/quantity_storage.php b/erp24/modul/shipment/fields/quantity_storage.php index 7559ab1..e28e62d 100644 --- a/erp24/modul/shipment/fields/quantity_storage.php +++ b/erp24/modul/shipment/fields/quantity_storage.php @@ -6,7 +6,7 @@ if ($whereInProductsId != " in ()") { $sql = "SELECT product_id,store_id,quantity FROM balances WHERE quantity>0 AND product_id $whereInProductsId AND store_id $orderStoresArrayRelation_in"; -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach ($data2 as $row2) { $data_up[$row2["product_id"]][$row2["store_id"]][0] = ($data_up[$row2["product_id"]][$row2["store_id"]][0] ?? 0) + $row2["quantity"]; diff --git a/erp24/modul/shipment/fields/quantity_warehouseman_fact.php b/erp24/modul/shipment/fields/quantity_warehouseman_fact.php index 67f226e..f39496d 100644 --- a/erp24/modul/shipment/fields/quantity_warehouseman_fact.php +++ b/erp24/modul/shipment/fields/quantity_warehouseman_fact.php @@ -6,7 +6,7 @@ $sql = "SELECT product_id,sum(value) as value FROM store_orders_fields_data WHER field_name='quantity_warehouseman_fact' AND value>0 AND store_id $orderStoresArrayRelation_in AND order_id=" . ($orderId ?? 0) . " AND color='' AND store_id!='' group by product_id"; -//var_dump($sql); die; + $data2=$db::getRows($sql); foreach($data2 as $row2) { $data_up[$row2["product_id"]][0][0] = ($data_up[$row2["product_id"]][0][0] ?? 0) + (int)$row2["value"]; diff --git a/erp24/modul/shipment/fields/quantity_warehouseman_fact_defective_related.php b/erp24/modul/shipment/fields/quantity_warehouseman_fact_defective_related.php index 3057fef..6c90315 100644 --- a/erp24/modul/shipment/fields/quantity_warehouseman_fact_defective_related.php +++ b/erp24/modul/shipment/fields/quantity_warehouseman_fact_defective_related.php @@ -4,7 +4,7 @@ global $orderId, $data_up, $whereInProductsId; // считаем получено по факту кладовщиком от закупок частей. $sql = "SELECT id FROM store_orders WHERE related_order_id=" . ($orderId ?? 0); -//var_dump($sql); die; + $data = $db::getRows($sql); $whereInOrderId=""; $i=0; @@ -20,7 +20,7 @@ if(!empty($whereInOrderId)) { $sql = "SELECT order_id,product_id, sum(value) value, color FROM store_orders_fields_data WHERE order_id IN ($whereInOrderId) AND product_id $whereInProductsId AND field_name='quantity_warehouseman_defective' AND store_id='' AND value>0 group by order_id,product_id,color"; -// var_dump($sql); die; + $data = $db::getRows($sql); foreach($data as $row) { if (!empty($row["color"])) { diff --git a/erp24/modul/shipment/fields/quantity_warehouseman_fact_related.php b/erp24/modul/shipment/fields/quantity_warehouseman_fact_related.php index dfe5082..381cf92 100644 --- a/erp24/modul/shipment/fields/quantity_warehouseman_fact_related.php +++ b/erp24/modul/shipment/fields/quantity_warehouseman_fact_related.php @@ -4,7 +4,7 @@ global $orderId, $data_up, $whereInProductsId; // считаем получено по факту кладовщиком от закупок частей. $sql = "SELECT id FROM store_orders WHERE related_order_id=" . ($orderId ?? 0); -//var_dump($sql); die; + $data = $db::getRows($sql); $whereInOrderId=""; $i=0; diff --git a/erp24/modul/shipment/fields/quantity_warehouseman_fact_summ.php b/erp24/modul/shipment/fields/quantity_warehouseman_fact_summ.php index 71179b1..fef6f46 100644 --- a/erp24/modul/shipment/fields/quantity_warehouseman_fact_summ.php +++ b/erp24/modul/shipment/fields/quantity_warehouseman_fact_summ.php @@ -4,7 +4,7 @@ global $orderId, $data_up, $whereInProductsId; // считаем получено по факту кладовщиком от закупок частей. $sql = "SELECT id FROM store_orders WHERE related_order_id=" . ($orderId ?? 0); -//var_dump($sql); die; + $data = $db::getRows($sql); $whereInOrderId=""; $i=0; @@ -20,7 +20,7 @@ if(!empty($whereInOrderId)) { $sql = "SELECT order_id,product_id, sum(value) value, color FROM store_orders_fields_data WHERE order_id IN ($whereInOrderId) AND product_id $whereInProductsId AND field_name in('quantity_warehouseman_defective','quantity_warehouseman_fact') AND store_id='' AND value>0 group by order_id,product_id,color"; -// var_dump($sql); die; + $data = $db::getRows($sql); foreach($data as $row) { if (!empty($row["color"])) { @@ -36,7 +36,7 @@ AND field_name in('quantity_warehouseman_defective','quantity_warehouseman_fact' $sql = "SELECT order_id,product_id, sum(value) value, color FROM store_orders_fields_data WHERE order_id=? AND product_id $whereInProductsId AND field_name in('quantity_warehouseman_defective','quantity_warehouseman_fact') AND store_id='' AND value>0 group by order_id,product_id,color"; -//var_dump($sql); var_dump($orderId); die; + $data = $db::getRows($sql, [$orderId]); foreach($data as $row) { if (!empty($row["color"])) { diff --git a/erp24/modul/shipment/fields/quantity_zakup_fact_summ.php b/erp24/modul/shipment/fields/quantity_zakup_fact_summ.php index 6fdf5d0..ba015ac 100644 --- a/erp24/modul/shipment/fields/quantity_zakup_fact_summ.php +++ b/erp24/modul/shipment/fields/quantity_zakup_fact_summ.php @@ -10,7 +10,7 @@ AND color='' AND store_id='' AND field_name IN ('quantity_zakup_fact','purchase_price') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]] = $row["value"]; diff --git a/erp24/modul/shipment/fields/quantity_zakup_new.php b/erp24/modul/shipment/fields/quantity_zakup_new.php index 2c6d5bd..9f3b8e9 100644 --- a/erp24/modul/shipment/fields/quantity_zakup_new.php +++ b/erp24/modul/shipment/fields/quantity_zakup_new.php @@ -7,7 +7,7 @@ $sql = "SELECT product_id,sum(value) as value,color FROM store_orders_fields_dat AND store_id $orderStoresArrayRelation_in AND store_id!='' AND order_id=? AND color!='' AND store_id!='' group by product_id,store_id,color"; -//var_dump($sql); var_dump($orderId); die; + $data = $db::getRows($sql, [$orderId]); foreach($data as $row) { $data_up[$row["product_id"]][0][$row["color"]] = ($data_up[$row["product_id"]][0][$row["color"]] ?? 0) + (int)$row["value"]; @@ -21,7 +21,7 @@ $sql = "SELECT product_id,sum(value) as value FROM store_orders_fields_data WHER AND store_id $orderStoresArrayRelation_in AND store_id!='' AND order_id=? AND color='' AND store_id!='' group by product_id"; -//var_dump($sql); var_dump($orderId); die; + $data = $db::getRows($sql, [$orderId]); foreach($data as $row) { $data_up[$row["product_id"]][0][0] = ($data_up[$row["product_id"]][0][0] ?? 0) + (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/sales_4weeks_cnt.php b/erp24/modul/shipment/fields/sales_4weeks_cnt.php index 0270c45..8f8b47a 100644 --- a/erp24/modul/shipment/fields/sales_4weeks_cnt.php +++ b/erp24/modul/shipment/fields/sales_4weeks_cnt.php @@ -11,7 +11,7 @@ WHERE s.id=i.check_id AND i.product_id $whereInProductsId AND s.store_id_1c $orderStoresArrayRelation_in AND s.date<='$date_start_sale 00:00:00' AND s.date>='$date_start_sale'::date -interval '$day_sales day' group BY i.product_id, s.store_id_1c "; -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach ($data2 as $row2) { $cnt = round((($row2["sale_cnt"] ?? 0) - ($row2["vozvr_cnt"] ?? 0)) / 4); diff --git a/erp24/modul/shipment/fields/sales_7day_amount_division.php b/erp24/modul/shipment/fields/sales_7day_amount_division.php index 7a3a443..8572da9 100644 --- a/erp24/modul/shipment/fields/sales_7day_amount_division.php +++ b/erp24/modul/shipment/fields/sales_7day_amount_division.php @@ -25,7 +25,7 @@ foreach($productGroupArray as $group => $pArray) { 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, s.operation, s.store_id_1c"; - //var_dump($sql); die; + $data2 = $db::getRows($sql); foreach($data2 as $row2) { $sale = ($row2["sale"] ?? 0) - ($row2["vozvr"] ?? 0); diff --git a/erp24/modul/shipment/fields/sales_7day_division.php b/erp24/modul/shipment/fields/sales_7day_division.php index 019ddee..75d5eaa 100644 --- a/erp24/modul/shipment/fields/sales_7day_division.php +++ b/erp24/modul/shipment/fields/sales_7day_division.php @@ -26,7 +26,7 @@ foreach($productGroupArray as $group =>$pArray) { 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 "); -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach ($data2 as $row2) { $cnt = ($row2["sale_cnt"] ?? 0) - ($row2["vozvr_cnt"] ?? 0); diff --git a/erp24/modul/shipment/fields/sales_amount.php b/erp24/modul/shipment/fields/sales_amount.php index 3d11f08..b3cbc06 100644 --- a/erp24/modul/shipment/fields/sales_amount.php +++ b/erp24/modul/shipment/fields/sales_amount.php @@ -27,7 +27,7 @@ if (!empty($date_start_sale)) { i.product_id $whereInProductsId AND s.store_id_1c $orderStoresArrayRelation_in AND s.date<='$date_start_sale 00:00:00' AND s.date>='$date_start_sale'::date -interval '7 day' group BY i.product_id, s.store_id_1c "; -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach ($data2 as $row2) { $cnt = ($row2["sale_cnt"] ?? 0) - ($row2["vozvr_cnt"] ?? 0); diff --git a/erp24/modul/shipment/fields/sales_cnt.php b/erp24/modul/shipment/fields/sales_cnt.php index a38e134..4c13b7c 100644 --- a/erp24/modul/shipment/fields/sales_cnt.php +++ b/erp24/modul/shipment/fields/sales_cnt.php @@ -11,7 +11,7 @@ FROM sales as s, sales_products as i WHERE s.id=i.check_id AND i.product_id $whereInProductsId AND s.store_id_1c $orderStoresArrayRelation_in AND s.date<='$date_start_sale 00:00:00' AND s.date>='$date_start_sale'::date -interval '$day_sales day' group BY i.product_id, s.store_id_1c "; -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach ($data2 as $row2) { $cnt = ($row2["sale_cnt"] ?? 0) - ($row2["vozvr_cnt"] ?? 0); diff --git a/erp24/modul/shipment/fields/sales_division_4weeks_cnt_avg.php b/erp24/modul/shipment/fields/sales_division_4weeks_cnt_avg.php index 30da1ec..a618c41 100644 --- a/erp24/modul/shipment/fields/sales_division_4weeks_cnt_avg.php +++ b/erp24/modul/shipment/fields/sales_division_4weeks_cnt_avg.php @@ -9,7 +9,7 @@ WHERE s.id=i.check_id AND i.product_id $whereInProductsId AND store_id_1c $orderStoresArrayRelation_in AND s.date<='$date_start_division 00:00:00' AND s.date>=('$date_start_division'::date - '$day_sales day'::interval) group BY i.product_id, s.store_id_1c "; -//var_dump($sql); die; + $data2 = $db::getRows($sql); foreach($data2 as $row2) { $cnt = round((($row2["sale_cnt"] ?? 0) - ($row2["vozvr_cnt"] ?? 0))/4); diff --git a/erp24/modul/shipment/fields/scheduled_delivery_cnt.php b/erp24/modul/shipment/fields/scheduled_delivery_cnt.php index 3098fe3..4c33dfe 100644 --- a/erp24/modul/shipment/fields/scheduled_delivery_cnt.php +++ b/erp24/modul/shipment/fields/scheduled_delivery_cnt.php @@ -8,7 +8,7 @@ global $whereInProductsId, $data_up; */ $sql = "SELECT id FROM store_orders WHERE status=5"; -//var_dump($sql); die; + $data = $db::getRows($sql); $whereInOrderId=""; $i=0; @@ -25,7 +25,7 @@ if(!empty($whereInOrderId) && $whereInProductsId != " in ()") { $sql = "SELECT product_id, store_id, value FROM store_orders_fields_data WHERE order_id IN ($whereInOrderId) AND product_id $whereInProductsId AND field_name='quantity_zakup_new' AND color='' AND value>0 group by product_id, store_id, value"; -// var_dump($sql); die; + $data=$db::getRows($sql); foreach($data as $row) { $data_up[$row["product_id"]][$row["store_id"]]["0"] = $row["value"]; diff --git a/erp24/modul/shipment/fields/score.php b/erp24/modul/shipment/fields/score.php index 104ba3d..b191a14 100644 --- a/erp24/modul/shipment/fields/score.php +++ b/erp24/modul/shipment/fields/score.php @@ -11,7 +11,7 @@ AND color='' AND store_id!='' AND field_name IN ('score') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $scoreArr[$row["product_id"]][$row["store_id"]] = (int)$row["value"]; @@ -42,7 +42,7 @@ AND color!='' AND store_id!='' AND field_name IN ('score') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $scoreArr[$row["product_id"]][$row["store_id"]][$row["color"]] = (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/storehouse_balance.php b/erp24/modul/shipment/fields/storehouse_balance.php index 2aa7860..fffee5f 100644 --- a/erp24/modul/shipment/fields/storehouse_balance.php +++ b/erp24/modul/shipment/fields/storehouse_balance.php @@ -10,7 +10,7 @@ order_id=? AND store_id='' AND field_name IN ('quantity_warehouseman_fact','division_summ') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { if (!$row["color"]) { diff --git a/erp24/modul/shipment/fields/storehouse_balance_store.php b/erp24/modul/shipment/fields/storehouse_balance_store.php index dd946d9..148a26d 100644 --- a/erp24/modul/shipment/fields/storehouse_balance_store.php +++ b/erp24/modul/shipment/fields/storehouse_balance_store.php @@ -10,7 +10,7 @@ AND color='' AND store_id='' AND field_name IN ('quantity_warehouseman_fact','division_store_summ') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]][0] = (int)$row["value"]; @@ -29,7 +29,7 @@ AND color!='' AND store_id='' AND field_name IN ('quantity_warehouseman_fact','division_store_summ') AND value!=0"; -//var_dump($sql); var_dump($orderId); die; + $dataF = $db::getRows($sql, [$orderId]); foreach($dataF as $row) { $FiledsDataArray[$row["field_name"]][$row["product_id"]][$row["color"]] = (int)$row["value"]; diff --git a/erp24/modul/shipment/fields/write_downs.php b/erp24/modul/shipment/fields/write_downs.php index 841b10c..04481e3 100644 --- a/erp24/modul/shipment/fields/write_downs.php +++ b/erp24/modul/shipment/fields/write_downs.php @@ -11,7 +11,7 @@ if(!empty($orderStoresArrayRelation_in) && !empty($date_start_sale)) { AND p.product_id $whereInProductsId AND w.store_id $orderStoresArrayRelation_in AND w.date<='$date_start_sale 00:00:00' AND w.date>='$date_start_sale'::date -interval '$periodDaysStats day' group BY p.product_id,w.store_id"; - //var_dump($sql); die; + $data2 = $db::getRows($sql); foreach($data2 as $row2) { $a = round($row2["cnt"] ?? 0); diff --git a/erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php b/erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php index 836f047..7cef63d 100644 --- a/erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php +++ b/erp24/modul/shipment/fields/write_offs_4week_cnt_avg.php @@ -13,7 +13,7 @@ AND p.product_id $whereInProductsId AND w.store_id $orderStoresArrayRelation_in AND w.date<='$date_start_sale 00:00:00' AND w.date>='$date_start_sale'::date -interval '$periodDaysStats day' group BY p.product_id,w.store_id"; -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach ($data2 as $row2) { $a = round(($row2["cnt"] ?? 0)/4); diff --git a/erp24/modul/shipment/fields/write_offs_4week_sum.php b/erp24/modul/shipment/fields/write_offs_4week_sum.php index df5189d..fdc063c 100644 --- a/erp24/modul/shipment/fields/write_offs_4week_sum.php +++ b/erp24/modul/shipment/fields/write_offs_4week_sum.php @@ -12,7 +12,7 @@ AND p.product_id $whereInProductsId AND w.store_id $orderStoresArrayRelation_in AND w.date<='$date_start_sale 00:00:00' AND w.date>='$date_start_sale'::date -interval '$periodDaysStats day' group BY p.product_id,w.store_id, p.summ"; -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach($data2 as $row2) { $a = round(($row2["summ"] ?? 0) / 4); diff --git a/erp24/modul/shipment/fields/write_offs_comments.php b/erp24/modul/shipment/fields/write_offs_comments.php index 709a07b..36790bf 100644 --- a/erp24/modul/shipment/fields/write_offs_comments.php +++ b/erp24/modul/shipment/fields/write_offs_comments.php @@ -35,7 +35,7 @@ foreach($productGroupArray as $group => $pArray) { AND w.date<='$date_start_sale2 00:00:00' AND w.date>='$date_start_sale2'::date -interval '$periodDaysStats_where day' group BY p.product_id,w.store_id, c.comment_id"; -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach($data2 as $row2) { $a = ($row2["comment_id"] ?? 0) . "=" . ($row2["cnt"] ?? 0) . "шт. "; diff --git a/erp24/modul/shipment/fields/write_offs_division.php b/erp24/modul/shipment/fields/write_offs_division.php index 40ca901..3a80658 100644 --- a/erp24/modul/shipment/fields/write_offs_division.php +++ b/erp24/modul/shipment/fields/write_offs_division.php @@ -25,7 +25,7 @@ foreach($productGroupArray as $group => $pArray) { AND p.product_id in($whereInProductsId_in) AND w.store_id $orderStoresArrayRelation_in AND w.date<='$date_start_division 00:00:00' AND w.date>='$date_start_division'::date -interval '$periodDaysStats day' group BY p.product_id,w.store_id"; -// var_dump($sql); die; + $data2 = $db::getRows($sql); $valAll = 0; foreach($data2 as $row2) { diff --git a/erp24/modul/shipment/fields/write_offs_sum.php b/erp24/modul/shipment/fields/write_offs_sum.php index 00ba8cf..8dc3d95 100644 --- a/erp24/modul/shipment/fields/write_offs_sum.php +++ b/erp24/modul/shipment/fields/write_offs_sum.php @@ -13,7 +13,7 @@ WHERE p.write_offs_id=w.id AND w.type='Брак' AND p.product_id $whereInProductsId AND w.store_id $orderStoresArrayRelation_in AND w.date<='$date_start_sale 00:00:00' AND w.date>='$date_start_sale'::date -interval '$periodDaysStats day' group BY p.product_id,w.store_id, p.summ"; -// var_dump($sql); die; + $data2 = $db::getRows($sql); foreach($data2 as $row2) { $a = $row2["summ"] ?? 0; diff --git a/erp24/modul/shipment/functionsShipment.php b/erp24/modul/shipment/functionsShipment.php index 585763f..6c29d82 100644 --- a/erp24/modul/shipment/functionsShipment.php +++ b/erp24/modul/shipment/functionsShipment.php @@ -113,7 +113,7 @@ foreach($data as $row) { $sql = "SELECT *, TO_CHAR(date_start, 'YYYY-MM-DD') as date_start, TO_CHAR(date_add, 'YYYY-MM-DD') as date_add, TO_CHAR(division_date, 'YYYY-MM-DD') as division_date, extract(epoch from date_update) as date_update FROM store_orders WHERE id=?"; $OrderData=$db::getRow($sql, [$orderId]); -//var_dump($OrderData); die; + if ($OrderData) { $providersIdInThisOrder = explode(",", $OrderData["providers_arr"]); $status_order_id = $OrderData["status"]; @@ -164,7 +164,7 @@ $whereInProductsId=" in ("; if (!empty($whereProvidersId)) { $z = "SELECT p.id, p.name, o.provider_id, o.price_zakup, p.parent_id, o.shipments_group_id FROM products_1c_options as o INNER JOIN products_1c as p ON o.provider_id in($whereProvidersId) AND p.id=o.id order by o.provider_id ASC, p.name ASC"; -// var_dump($whereProvidersId); die; + $data2 = $db::getRows($z); } else { $data2 = []; @@ -258,7 +258,7 @@ global $db; // готовим массим со всеми данными по столбцам по каждому товару магазину и цвету Если NULL - то это сумма по магазинам и по цветам $sql = "SELECT field_name,product_id,store_id,(CASE WHEN value_text!='' THEN value_text ELSE value::text END) as value,color FROM store_orders_fields_data WHERE order_id=?"; -//var_dump($orderId); die; + $dataF=$db::getRows($sql,[$orderId]); $FiledsData = []; foreach($dataF as $row) { @@ -770,7 +770,6 @@ function insert_store_orders_fields($massivSQL,$field_name,$massivTitle=[], $pri 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($sql2); die; $db::sql($sql, [$productId, $orderId, $storeId, $field_name, $field_id, $value, $value_text, $color, $title, $value, $value_text , $title]); } }