Files
fdesk/app/command/InquiryReissueCommand.php
2025-12-11 15:23:02 +08:00

43 lines
1.0 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
namespace app\command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use support\Db;
use Webman\RedisQueue\Redis as RedisQueueRedis;
/**
* 询盘补发
*/
class InquiryReissueCommand extends Command
{
protected static $defaultName = 'iq-bf';
protected static $defaultDescription = '';
protected function execute(InputInterface $input, OutputInterface $output): int
{
$inquiries = Db::table('inquiry_log')
->where('sync_crm', 0)
->where('id', '>', 33785)
->orderBy('id')
->get();
foreach ($inquiries as $row) {
$inquiryId = (int)$row->id;
var_dump('补发ID:'.$inquiryId);
sleep(1);
$res = [
'id' => $inquiryId
];
RedisQueueRedis::send('inquiry-to-crm-new', $res);
}
return self::SUCCESS;
}
}