]);
}
- public function actionWeeklyBouquetProductsForecast($storeId, $month, $year, $week)
- {
- Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
-
- if (!$month || !$year || $week === null) {
- return ['success' => false, 'message' => 'Нет параметров'];
- }
-
- $service = new AutoPlannogrammaService();
- $result = $service->getWeeklyBouquetProductsForecast($month, $year, $storeId);
-
- if (!is_array($result)) {
- return ['success' => false, 'message' => 'Ошибка структуры данных'];
- }
-
- $grouped = [];
-
-
-
- if ($week !== null) {
- $week = (int)$week;
- $grouped = isset($grouped[$week]) ? [$week => $grouped[$week]] : [];
- }
-
- return [
- 'success' => true,
- 'data' => $grouped,
- ];
- }
-
public function actionGetSubcategories(string $category, int $year, int $week): array
{
Yii::$app->response->format = Response::FORMAT_JSON;