From ff1411f1d83e7f20908da54b6acadd4166a831df Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Wed, 3 Sep 2025 16:31:49 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF?= =?utf8?q?=D0=BE=20MR?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/FileService.php | 3 ++- erp24/views/products1c-nomenclature-actuality/index.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/erp24/services/FileService.php b/erp24/services/FileService.php index 929384de..f99db520 100755 --- a/erp24/services/FileService.php +++ b/erp24/services/FileService.php @@ -16,6 +16,7 @@ use yii_app\records\Images; class FileService { + private const DEFAULT_MAX_BYTES = 8 * 1024 * 1024; // 8 MiB public static function uploadFile($label, $admin_id) { if (isset($_FILES[$label]["name"])) { $isMultiple = is_array($_FILES[$label]["name"]); @@ -280,7 +281,7 @@ class FileService * @param int $maxBytes Максимальный размер, байт (например, 8 МБ) * @param int $timeout Таймаут запроса, сек */ - public static function downloadAsUploadedFile(string $url, int $maxBytes = 8_000_000, int $timeout = 20): UploadedFile + public static function downloadAsUploadedFile(string $url, int $maxBytes = self::DEFAULT_MAX_BYTES, int $timeout = 20): UploadedFile { $scheme = parse_url($url, PHP_URL_SCHEME); if (!in_array($scheme, ['http', 'https'], true)) { diff --git a/erp24/views/products1c-nomenclature-actuality/index.php b/erp24/views/products1c-nomenclature-actuality/index.php index 1f95de89..734d0391 100644 --- a/erp24/views/products1c-nomenclature-actuality/index.php +++ b/erp24/views/products1c-nomenclature-actuality/index.php @@ -25,8 +25,11 @@ $this->registerJsFile('/js/products1cNomenclatureActuality/index.js', ['position function monthList() { $list = []; - $start = new DateTime('2024-01'); - $end = new DateTime('2026-12'); + $tz = new DateTimeZone('Europe/Moscow'); + $now = new DateTime('now', $tz); + $start = (clone $now)->modify('first day of january last year'); + $end = (clone $now)->modify('last day of december next year'); + while ($start <= $end) { $key = $start->format('Y-m'); $list[$key] = $start->format('Y‑m'); -- 2.39.5