From 4988830ccc04611119b8f623976a158998ef48a5 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Thu, 21 Aug 2025 12:00:43 +0300 Subject: [PATCH] =?utf8?q?=D0=9C=D0=B5=D0=BD=D1=8F=D0=B5=D0=BC=20=D1=84?= =?utf8?q?=D0=B8=D0=BB=D1=8C=D1=82=D1=80=20=D0=BD=D0=B0=20=D0=BF=D1=80?= =?utf8?q?=D0=BE=D0=BC=D0=B5=D0=B6=D1=83=D1=82=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ...ducts1cNomenclatureActualityController.php | 20 +++++++++++-------- .../index.php | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/erp24/controllers/Products1cNomenclatureActualityController.php b/erp24/controllers/Products1cNomenclatureActualityController.php index 641c335a..3003c2b7 100644 --- a/erp24/controllers/Products1cNomenclatureActualityController.php +++ b/erp24/controllers/Products1cNomenclatureActualityController.php @@ -154,13 +154,15 @@ class Products1cNomenclatureActualityController extends Controller ->where('a.guid = n.id'); if ($hasDf && !$hasDt) { - $dateExists->andWhere(['a.date_from' => $df]); + $dateExists//->andWhere(['a.date_from' => $df]) + ->andWhere(['>=', 'a.date_to', $df]);; } elseif (!$hasDf && $hasDt) { - $dateExists->andWhere(['a.date_to' => $dt]); + $dateExists//->andWhere(['a.date_to' => $dt]) + ->andWhere(['<=', 'a.date_from', $dt]); } else { $dateExists - ->andWhere(['>=', 'a.date_from', $df]) - ->andWhere(['<=', 'a.date_to', $dt]); + ->andWhere(['>=', 'a.date_to', $df]) + ->andWhere(['<=', 'a.date_from', $dt]); } if (!empty($filter->onlyInactive)) { @@ -171,12 +173,14 @@ class Products1cNomenclatureActualityController extends Controller $query->with(['actualities' => function ($q) use ($hasDf, $hasDt, $df, $dt) { if ($hasDf && !$hasDt) { - $q->andWhere(['date_from' => $df]); + $q//->andWhere(['date_from' => $df]) + ->andWhere(['>=', 'date_to', $df]); } elseif (!$hasDf && $hasDt) { - $q->andWhere(['date_to' => $dt]); + $q//->andWhere(['date_to' => $dt]) + ->andWhere(['<=', 'date_from', $dt]); } else { - $q->andWhere(['>=', 'date_from', $df]) - ->andWhere(['<=', 'date_to', $dt]); + $q->andWhere(['>=', 'date_to', $df]) + ->andWhere(['<=', 'date_from', $dt]); } $q->orderBy(['date_from' => SORT_ASC]); }]); diff --git a/erp24/views/products1c-nomenclature-actuality/index.php b/erp24/views/products1c-nomenclature-actuality/index.php index fba62078..6aa70cef 100644 --- a/erp24/views/products1c-nomenclature-actuality/index.php +++ b/erp24/views/products1c-nomenclature-actuality/index.php @@ -25,7 +25,7 @@ $this->registerJsFile('/js/products1cNomenclatureActuality/index.js', ['position function monthList() { $list = []; - $start = new DateTime('2021-01'); + $start = new DateTime('2025-01'); $end = new DateTime('2026-12'); while ($start <= $end) { $key = $start->format('Y-m'); -- 2.39.5