From 669c12a429e38e697d89e31847198414350c2946 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Fri, 6 Sep 2024 16:47:29 +0300 Subject: [PATCH] =?utf8?q?=D0=BF=D0=BE=D1=87=D0=B8=D0=BD=D0=B8=D0=BB=20?= =?utf8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20-?= =?utf8?q?=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB=20=D1=80=D0=B5?= =?utf8?q?=D0=B4=D0=B8=D1=80=D0=B5=D0=BA=D1=82=20=D0=BD=D0=B0=20=D1=80?= =?utf8?q?=D0=B5=D0=BD=D0=B4=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/ClusterLinkEditController.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/erp24/controllers/ClusterLinkEditController.php b/erp24/controllers/ClusterLinkEditController.php index 3a1acb19..d52af99f 100644 --- a/erp24/controllers/ClusterLinkEditController.php +++ b/erp24/controllers/ClusterLinkEditController.php @@ -61,7 +61,7 @@ class ClusterLinkEditController extends Controller * @return string * @throws NotFoundHttpException if the model cannot be found */ - public function actionView($year) + public function actionView($year = null) { $stores = CityStore::getNames(); $clusters = Cluster::getNames(); @@ -69,6 +69,10 @@ class ClusterLinkEditController extends Controller $years = array_combine(range(2023, 2030), range(2023, 2030)); $monthNames = PlanStore::$month_name; + if (empty($year)){ + $year = date("Y"); + } + $yearPost = $year; $intervals = DateHelper::getIntervals($year); @@ -188,6 +192,7 @@ class ClusterLinkEditController extends Controller } } + $inputData = []; foreach ($valuesArray as $key => $rowArray) { $arrayRow = []; @@ -254,6 +259,7 @@ class ClusterLinkEditController extends Controller $intervals[$store] = $storeDataRow; } + // Yii::info($intervals, 'application'); $clusterHistory = []; $clusterSetList = []; @@ -280,7 +286,7 @@ class ClusterLinkEditController extends Controller ]; } } - + //var_dump($clusterSetList); if (!empty($clusterSetList)) { ClusterCalendar::deleteAll(['year' => $yearPost]); foreach ($clusterSetList as $item) { @@ -306,9 +312,10 @@ class ClusterLinkEditController extends Controller } } + //var_dump($yearPost); // die('stop'); - return $this->redirect(['view', 'year' => $yearPost]); - return $this->redirect('/cluster_link_store_edit/view', [ + // return $this->redirect('view', ['year' => $yearPost]); + return $this->render('/cluster_link_store_edit/update', [ 'model' => $model, 'years' => $years, 'year' => $yearPost, -- 2.39.5