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("主动拉取充值订单状态完成"); } }