From b4ff6c9ce1d943377a3eb1288f8f753d5d5a3220 Mon Sep 17 00:00:00 2001 From: Nikita Kiselev Date: Sun, 14 Dec 2025 17:07:06 +0300 Subject: [PATCH] Improve CustomerCountsCommand with description and output formatting --- .cursor/prompts/changelog.md | 1 + module/oc_telegram_shop/upload/cli.php | 2 + .../Commands/CustomerCountsCommand.php | 43 +++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100755 module/oc_telegram_shop/upload/oc_telegram_shop/console/Commands/CustomerCountsCommand.php diff --git a/.cursor/prompts/changelog.md b/.cursor/prompts/changelog.md index f561f01..a6daa4a 100644 --- a/.cursor/prompts/changelog.md +++ b/.cursor/prompts/changelog.md @@ -103,3 +103,4 @@ + diff --git a/module/oc_telegram_shop/upload/cli.php b/module/oc_telegram_shop/upload/cli.php index 86c6421..22de9a9 100755 --- a/module/oc_telegram_shop/upload/cli.php +++ b/module/oc_telegram_shop/upload/cli.php @@ -2,6 +2,7 @@ add($app->get(ScheduleListCommand::class)); $console->add($app->get(PulseSendEventsCommand::class)); $console->add($app->get(ImagesWarmupCacheCommand::class)); $console->add($app->get(ImagesCacheClearCommand::class)); +$console->add($app->get(CustomerCountsCommand::class)); $console->run(); diff --git a/module/oc_telegram_shop/upload/oc_telegram_shop/console/Commands/CustomerCountsCommand.php b/module/oc_telegram_shop/upload/oc_telegram_shop/console/Commands/CustomerCountsCommand.php new file mode 100755 index 0000000..3cc7dc2 --- /dev/null +++ b/module/oc_telegram_shop/upload/oc_telegram_shop/console/Commands/CustomerCountsCommand.php @@ -0,0 +1,43 @@ +database = $database; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output); + + $io->title('Обновление счетчиков заказов клиентов'); + $io->writeln('Выполняется пересчёт счетчиков заказов...'); + + $sql = <<database->statement($sql); + + $io->success('Счетчики заказов успешно обновлены!'); + + return Command::SUCCESS; + } +}