2025-12-11 07:06:25 +00:00
|
|
|
|
<?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
|
|
|
|
|
|
{
|
2025-12-11 15:23:36 +08:00
|
|
|
|
protected static $defaultName = 'iq-bf';
|
2025-12-11 07:06:25 +00:00
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|