Files
huangjingfen/pro_v3.5.1/app/command/HjfReleasePoints.php
apple 78de918c37 Initial commit: queue workspace
Made-with: Cursor
2026-03-21 02:55:24 +08:00

50 lines
1.3 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
namespace app\command;
use app\services\hjf\PointsReleaseServices;
use think\console\Command;
use think\console\Input;
use think\console\Output;
/**
* 积分每日释放命令
*
* 用法:
* php think hjf:release-points
*
* 触发时机:
* - 每天凌晨 00:01 由 crontab 或 Swoole Timer 调用
* - P4-05 联调验证时手动执行
*
* Class HjfReleasePoints
* @package app\command
*/
class HjfReleasePoints extends Command
{
protected function configure(): void
{
$this->setName('hjf:release-points')
->setDescription('执行黄精粉健康商城每日积分释放frozen_points × 4‰ → available_points');
}
protected function execute(Input $input, Output $output): int
{
$output->writeln('[HjfReleasePoints] 开始执行积分释放...');
/** @var PointsReleaseServices $service */
$service = app()->make(PointsReleaseServices::class);
$result = $service->executeRelease();
$output->writeln(sprintf(
'[HjfReleasePoints] 完成:处理 %d 人,共释放 %d 积分,日期 %s',
$result['processed'],
$result['total_released'],
$result['release_date']
));
return 0;
}
}