From: fomichev Date: Mon, 19 May 2025 09:27:05 +0000 (+0300) Subject: Исправление наименования X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=2533fd133b8f0a44beb9e2e4fec421134accf0b5;p=erp24_rep%2Fyii-erp24%2F.git Исправление наименования --- 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/get-guid-bouquet.php deleted file mode 100644 index f51b1c2e..00000000 --- a/erp24/views/bouquet/get-guid-bouquet.php +++ /dev/null @@ -1,52 +0,0 @@ -title = 'Импорт прогноза по букетам'; -?> -
-

title) ?>

- - ['enctype' => 'multipart/form-data']]); ?> -field($model, 'excelFile')->fileInput() ?> -
- 'btn btn-success']) ?> -
- - - - $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - 'id', - 'guid', - [ - 'attribute' => 'group', - 'label' => 'Группа букета', - ], - [ - 'attribute' => 'name', - 'label' => 'Название букета', - ], - 'year', - 'month', - 's_store', - 'm_store', - 'l_store', - 'xl_store', - 'marketplace', - 'internet', - ], - ]) ?> - - -
diff --git a/erp24/views/bouquet/import-matrix-bouquets-forecast.php b/erp24/views/bouquet/import-matrix-bouquets-forecast.php new file mode 100644 index 00000000..f51b1c2e --- /dev/null +++ b/erp24/views/bouquet/import-matrix-bouquets-forecast.php @@ -0,0 +1,52 @@ +title = 'Импорт прогноза по букетам'; +?> +
+

title) ?>

+ + ['enctype' => 'multipart/form-data']]); ?> +field($model, 'excelFile')->fileInput() ?> +
+ 'btn btn-success']) ?> +
+ + + + $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + 'id', + 'guid', + [ + 'attribute' => 'group', + 'label' => 'Группа букета', + ], + [ + 'attribute' => 'name', + 'label' => 'Название букета', + ], + 'year', + 'month', + 's_store', + 'm_store', + 'l_store', + 'xl_store', + 'marketplace', + 'internet', + ], + ]) ?> + + +