cmbYouku_Api/app/cmd/QueryRechargeOrder.php

28 lines
827 B
PHP
Raw Permalink Normal View History

2024-07-01 15:57:07 +08:00
<?php
namespace app\cmd;
use app\model\Order;
use app\service\RechargeService;
use think\Collection;
use think\console\Command;
use think\console\Input;
use think\console\Output;
class QueryRechargeOrder extends Command
{
protected function configure()
{
$this->setName('queryRechargeOrder')->setDescription('主动拉取充值订单状态');
}
protected function execute(Input $input, Output $output)
{
Order::where(['order_status' => Order::STATUS_RECHARGE_ING])->field('*')->chunk(100, function (Collection $orderCollection) use (&$output) {
foreach ($orderCollection as $collection) {
(new RechargeService())->queryRechargeOrder($collection['order_number']);
}
});
$output->writeln("主动拉取充值订单状态完成");
}
}