From: Vladimir Fomichev Date: Fri, 6 Sep 2024 13:47:29 +0000 (+0300) Subject: починил сохранение - заменил редирект на рендер X-Git-Tag: 1.5~4^2~14 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=669c12a429e38e697d89e31847198414350c2946;p=erp24_rep%2Fyii-erp24%2F.git починил сохранение - заменил редирект на рендер --- 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,