From 5a274a0e78be66c342fd31103a9d80a11c4bd090 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Wed, 10 Apr 2024 13:20:01 +0300 Subject: [PATCH] =?utf8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?utf8?q?=D0=BE=20=D0=B7=D0=B0=D0=BA=D0=B0=D0=B7=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/OrdersController.php | 2 ++ erp24/modul/orders/delivery.php | 23 ++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/erp24/controllers/OrdersController.php b/erp24/controllers/OrdersController.php index ae144847..e6a951e5 100644 --- a/erp24/controllers/OrdersController.php +++ b/erp24/controllers/OrdersController.php @@ -4,6 +4,8 @@ namespace app\controllers; include_once('../inc/base_new.php'); include_once('../inc/amo_inc.php'); +error_reporting(E_ALL ^ E_NOTICE); +ini_set("memory_limit", "256M"); use Exception; use Yii; diff --git a/erp24/modul/orders/delivery.php b/erp24/modul/orders/delivery.php index 8dda8c09..55ee50ca 100644 --- a/erp24/modul/orders/delivery.php +++ b/erp24/modul/orders/delivery.php @@ -3,7 +3,7 @@ include_once(dirname(__DIR__, 2) . "/startup.php"); include_once(dirname(__DIR__, 2) . "/inc/db.php"); include_once(dirname(__DIR__, 2) . "/inc/base_new.php"); include_once(dirname(__DIR__, 2) . "/inc/design_new.php"); - +error_reporting(E_ALL); try { //include"templates/top.php"; @@ -223,10 +223,23 @@ foreach($_REQUEST["statuses"] ?? [] as $is =>$idf) { $checkarr= $db::getRows("SELECT * FROM sales WHERE date >= NOW()- 37 * INTERVAL '1 day' "); //$cheks_txt="; +$sale = []; +$check_sale_cnt = []; +$check_vozvrat_cnt = []; foreach($checkarr as $checkr) { + if (!in_array($checkr["order_id"], $check_sale_cnt)) { + $check_sale_cnt[$checkr["order_id"]] = 0; + } + if (!in_array($checkr["order_id"], $check_vozvrat_cnt)) { + $check_vozvrat_cnt[$checkr["order_id"]] = 0; + } + if (!in_array($checkr["order_id"], $sale)) { + $sale[$checkr["order_id"]] = ''; + } $cheks_txt ="
Чек ".$checkr["operation"]." ".round($checkr["summ"],2)."руб. ".$checkr["number"]." ".$checkr["date"]." продавец ".$usersArr[$checkr["seller_id"]]." "; +$cheks_txt .="\">Чек ".$checkr["operation"]." ".round($checkr["summ"],2)."руб. ".$checkr["number"]." ".$checkr["date"]; +$cheks_txt .=" продавец ".($usersArr[$checkr["seller_id"]] ?? '-')." "; if($checkr["operation"]=="Продажа") $cheks_txt .="сделать возврат"; $cheks_txt .="
"; @@ -315,7 +328,7 @@ echo" ".$row["id"]." / ".$row["amo_id"].""; -if(in_array($row["amo_id"], $in_orders)) { +if(in_array($row["amo_id"], $in_orders ?? [])) { //echo"ДУБЛЬ! ".$row["amo_id"].""; echo'удалить заказ'; $_SESSION["order_id_dell"][$row["id"]]=$row["amo_id"]; @@ -541,7 +554,7 @@ echo"Итого $itog руб. всего $cnt "; } catch (Exception $e) { - echo 'Выброшено исключение: ', $e->getMessage(), "\n"; + echo 'Выброшено исключение: '. $e->getMessage() . ', line:' . $e->getLine(). "\n"; } -- 2.39.5