From: Vladimir Fomichev Date: Wed, 3 Sep 2025 13:31:49 +0000 (+0300) Subject: Правки по MR X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=ff1411f1d83e7f20908da54b6acadd4166a831df;p=erp24_rep%2Fyii-erp24%2F.git Правки по MR --- 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');