]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Правки по MR
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 3 Sep 2025 13:31:49 +0000 (16:31 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 3 Sep 2025 13:31:49 +0000 (16:31 +0300)
erp24/services/FileService.php
erp24/views/products1c-nomenclature-actuality/index.php

index 929384de45f6de71c06f6ed464b7165c0287fc25..f99db520ef73e258cff82a9b17fd610bbd49ff2c 100755 (executable)
@@ -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)) {
index 1f95de8983246e65ca9385fb5ad3a1b6738f477a..734d03917c2f852d1410003fd6a09826c7b49d3c 100644 (file)
@@ -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');