pendingUsers($service->automaticCourses()) ->chunkById(200, function ($users) use ($service, &$updated) { foreach ($users as $user) { $updated += $service->promote($user->id, $user->source_start_date); } }, 'users.id', 'id'); $this->info("自动入库完成,共补齐 {$updated} 位学员。"); return 0; } }