]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
починил сохранение - заменил редирект на рендер
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 6 Sep 2024 13:47:29 +0000 (16:47 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 6 Sep 2024 13:47:29 +0000 (16:47 +0300)
erp24/controllers/ClusterLinkEditController.php

index 3a1acb19230846bf9e8f5fe9c811766527e7312a..d52af99f3a14b24ef6eb5e90ae87de2141cbee90 100644 (file)
@@ -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,