oportunidades 5
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-10 14:15:28 +02:00
parent 6ddafc95ba
commit 01405cbf8a
144 changed files with 28903 additions and 1103 deletions
@@ -230,6 +230,9 @@ class PortalManagementController extends Controller
]);
$query = $model::query();
if ($resource === 'opportunities') {
if (Schema::hasColumn('opportunities', 'owner_user_id')) {
$query = app(\App\Services\PortalProfileAccess::class)->scope(Opportunity::query(), $request->user());
}
$query->with('primaryTerritory:id,name,location_type,source_system,source_code');
if (isset($filters['geography_scope'])) {
$query->where('geography_scope', $filters['geography_scope']);
@@ -263,7 +266,7 @@ class PortalManagementController extends Controller
'filters' => $filters,
'sectors' => $resource === 'opportunities' ? Sector::orderBy('name')->get(['id', 'name']) : [],
'geographyReviewCount' => $resource === 'opportunities'
? Opportunity::where('geography_scope', 'unspecified')->count()
? (clone $query)->where('geography_scope', 'unspecified')->count()
: 0,
]);
}