allocatr/application/common/command/CheckTTSTaskCommand.php
2025-06-05 21:57:37 +08:00

35 lines
943 B
PHP
Raw 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
namespace app\common\command;
use app\admin\model\Message;
use app\admin\model\OrderDispatch;
use app\admin\model\OrderDispatchRecord;
use app\admin\model\TtsLog;
use app\common\Logic\NoticeLogic;
use think\console\Command;
use think\console\Input;
use think\console\Output;
class CheckTTSTaskCommand extends Command
{
protected function configure()
{
$this->setName('check:dispatch-tts-task')
->setDescription('语音发送任务每1分钟执行一次');
}
protected function execute(Input $input, Output $output){
$Model = new TtsLog();
$ttsService = new NoticeLogic();
$Model->where('status','=',0)
->chunk(100, function ($list)use($ttsService) {
foreach ($list as $item) {
$ttsService->callIt($item);
echo $item->id.PHP_EOL;
}
});
$output->info('OVER');
}
}