Finish mzl_inquery
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user