35 lines
1012 B
PHP
35 lines
1012 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace app\command;
|
|
|
|
use app\common\service\qywx\QywxCustomerAcquisitionCustomerService;
|
|
use think\console\Command;
|
|
use think\console\Input;
|
|
use think\console\Output;
|
|
|
|
/** 每分钟重试获客助手 message_from_customer/customer_start_chat 回调。 */
|
|
class QywxRetryCustomerAcquisitionEvents extends Command
|
|
{
|
|
protected function configure()
|
|
{
|
|
$this->setName('qywx:retry-customer-acquisition-events')
|
|
->setDescription('重试 30 分钟有效期内失败的企业微信获客会话回调');
|
|
}
|
|
|
|
protected function execute(Input $input, Output $output): int
|
|
{
|
|
$result = (new QywxCustomerAcquisitionCustomerService())->retryPending(100);
|
|
$output->writeln(sprintf(
|
|
'QYWX_CUSTOMER_ACQUISITION_RETRY selected=%d success=%d failed=%d expired=%d',
|
|
$result['selected'],
|
|
$result['success'],
|
|
$result['failed'],
|
|
$result['expired']
|
|
));
|
|
|
|
return 0;
|
|
}
|
|
}
|