From: pavlikov_maxim Date: Fri, 19 Apr 2024 08:03:22 +0000 (+0300) Subject: фикс модуля write-offs X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=e531cd649026c97e50c18d10d5ec198defbfc744;p=yii-erp24%2F.git фикс модуля write-offs --- diff --git a/erp24/views/write-offs/comments.php b/erp24/views/write-offs/comments.php index dcc870d..df583d1 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 bf56f5d..aa8d012 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 '';