From e531cd649026c97e50c18d10d5ec198defbfc744 Mon Sep 17 00:00:00 2001 From: pavlikov_maxim Date: Fri, 19 Apr 2024 11:03:22 +0300 Subject: [PATCH] =?utf8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BC=D0=BE=D0=B4?= =?utf8?q?=D1=83=D0=BB=D1=8F=20write-offs?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/views/write-offs/comments.php | 2 +- erp24/views/write-offs/index.php | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/erp24/views/write-offs/comments.php b/erp24/views/write-offs/comments.php index dcc870d7..df583d1e 100644 --- a/erp24/views/write-offs/comments.php +++ b/erp24/views/write-offs/comments.php @@ -96,7 +96,7 @@ foreach($data as $row) $comments[$row["product_id"]][$row["comment_id"]]=$row["q -$data=$db::getRows("SELECT *,DATE_FORMAT(date, '%d.%m.%Y %H:%i') as date2 FROM write_offs WHERE id=?",[$write_offs_id]); +$data=$db::getRows("SELECT *,TO_CHAR(date, 'DD.MM.YYYY HH:MI') as date2 FROM write_offs WHERE id=?",[$write_offs_id]); foreach($data as $row) { $items=json_decode($row["items"],true,512,JSON_UNESCAPED_UNICODE); diff --git a/erp24/views/write-offs/index.php b/erp24/views/write-offs/index.php index bf56f5d2..aa8d0122 100644 --- a/erp24/views/write-offs/index.php +++ b/erp24/views/write-offs/index.php @@ -62,7 +62,7 @@ $limit = 100; $offset = !empty($_GET['p']) ? (($_GET['p'] - 1) * $limit) : 0; $offset = (int)$offset; //получаем количество записей -$resultNum = $db::run("SELECT COUNT(*) as postNum FROM write_offs WHERE 1 $where"); +$resultNum = $db::run("SELECT COUNT(*) as postNum FROM write_offs WHERE 1=1 $where"); $resultNum = $resultNum ? $resultNum->fetchAll() : false; $rowCount = isset($resultNum['postNum']) ? $resultNum['postNum'] : 0; //инициализируем класс pagination @@ -96,7 +96,8 @@ echo '
'; $summ_retail = 0; -$data = $db::run("SELECT *,DATE_FORMAT(date, '%d.%m.%Y %H:%i') as date2 FROM write_offs WHERE 1 $where order by date DESC LIMIT $offset,$limit"); +$sql = "SELECT *,TO_CHAR(date, 'DD.MM.YYYY HH:MI') as date2 FROM write_offs WHERE 1=1 $where order by date DESC LIMIT $limit OFFSET $offset"; +$data = $db::run($sql); $data = $data ? $data->fetchAll() : false; foreach (is_array($data) ? $data : [] as $row) { @@ -112,12 +113,12 @@ foreach (is_array($data) ? $data : [] as $row) { if (empty($store_id)) echo '' . $stores[$row["store_id"]] . ' '; - echo ' - -комментарии -' . $row["date2"] . ' ' . $row["type"] . ' -' . $row["number"] . ' ' . $row["based_on"] . ' ' . $row["comment"] . ' -'; +// echo ' +// +//комментарии +//' . $row["date2"] . ' ' . $row["type"] . ' +//' . $row["number"] . ' ' . $row["based_on"] . ' ' . $row["comment"] . ' +//'; echo ''; echo ''; -- 2.39.5