select(DB::raw("DISTINCT(`uid`) as uid"))->get(); foreach ($users as $user) { try { $um = UserModel::findOrFail($user->uid); if ($um->partner_id > 0) { dump(StoreSelfPartnerJob::dispatch($um->uid)); } } catch (\Exception $exception) { } } } }