setName('es:import')->setDescription('test'); } protected function execute(Input $input, Output $output) { $count=0; Mobile::where('type',1)->where('id','>',135950454)->chunk(10000,function ($mobiles)use (&$count){ EsMobileService::addMobiles($mobiles); $count+=count($mobiles); $this->output->info("count:{$count}"); }); } }