43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
|
|
<?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;
|
|||
|
|
}
|
|||
|
|
}
|