From 2533fd133b8f0a44beb9e2e4fec421134accf0b5 Mon Sep 17 00:00:00 2001 From: fomichev Date: Mon, 19 May 2025 12:27:05 +0300 Subject: [PATCH] =?utf8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B0=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE?= =?utf8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/BouquetController.php | 16 ++++++++-------- ...t.php => import-matrix-bouquets-forecast.php} | 0 2 files changed, 8 insertions(+), 8 deletions(-) rename erp24/views/bouquet/{get-guid-bouquet.php => import-matrix-bouquets-forecast.php} (100%) diff --git a/erp24/controllers/BouquetController.php b/erp24/controllers/BouquetController.php index 2ab8ce8a..f6bb6404 100644 --- a/erp24/controllers/BouquetController.php +++ b/erp24/controllers/BouquetController.php @@ -265,15 +265,15 @@ class BouquetController extends Controller { $request = Yii::$app->request; $post = $request->post(); - $month = $post['DynamicModel']['month'] ?? 5; - $year = $post['DynamicModel']['year'] ?? 2025; + $month = $post['DynamicModel']['month'] ?? (int)date('m'); + $year = $post['DynamicModel']['year'] ?? (int)date('Y'); $model = DynamicModel::validateData( ['month' => $month, 'year' => $year], [ [['month', 'year'], 'required'], ['month', 'integer', 'min' => 1, 'max' => 12], - ['year', 'integer', 'min' => 2000, 'max' => 2100], + ['year', 'integer', 'min' => 2020, 'max' => 2100], ] ); @@ -310,8 +310,8 @@ class BouquetController extends Controller $request->post('DynamicModel', []) ); - $month = $params['month'] ?? 5; - $year = $params['year'] ?? 2025; + $month = $params['month'] ?? (int)date('m'); + $year = $params['year'] ?? (int)date('Y'); $storeId = $params['storeId'] ?? 2; $matrix = $params['matrix'] ?? []; @@ -322,7 +322,7 @@ class BouquetController extends Controller [['month','year','storeId'], 'required'], ['month','integer','min'=>1,'max'=>12], ['storeId','integer','min'=>1], - ['year','integer','min'=>2000,'max'=>2100], + ['year','integer','min'=>2020,'max'=>2100], ] ); @@ -354,7 +354,7 @@ class BouquetController extends Controller 'matrixGroups' => $matrixGroups, ]); } - public function actionGetGuidBouquets() + public function actionImportMatrixBouquetsForecast() { $model = new DynamicModel(['excelFile']); $model->addRule('excelFile', 'file', ['extensions' => ['xls', 'xlsx'], 'skipOnEmpty' => false]); @@ -438,7 +438,7 @@ class BouquetController extends Controller $dataProvider = $searchModel->search(Yii::$app->request->queryParams); - return $this->render('get-guid-bouquet', [ + return $this->render('import-matrix-bouquets-forecast', [ 'searchModel' => $searchModel, 'model' => $model, 'dataProvider' => $dataProvider, diff --git a/erp24/views/bouquet/get-guid-bouquet.php b/erp24/views/bouquet/import-matrix-bouquets-forecast.php similarity index 100% rename from erp24/views/bouquet/get-guid-bouquet.php rename to erp24/views/bouquet/import-matrix-bouquets-forecast.php -- 2.39.5