@@ -34,6 +34,10 @@ final class EvidenceRepository
|
||||
if (! empty($filters['nature'])) {
|
||||
$builder->where('s.nature', $filters['nature']);
|
||||
}
|
||||
if ($filters['public_only'] ?? false) {
|
||||
$builder->where('d.data_classification', 'public')->where('d.rights_status', '!=', 'restricted')
|
||||
->whereExists(fn ($q) => $q->selectRaw('1')->from('portal_resources as r')->whereColumn('r.document_id', 'd.id')->where('r.published', true)->where('r.rights_status', '!=', 'restricted'));
|
||||
}
|
||||
|
||||
return array_values($builder->orderByDesc('rank')->orderBy('c.id')->limit((int) config('investmoz_ai.retrieval_limit', 5))
|
||||
->get()->map(fn ($row) => (array) $row)->all());
|
||||
|
||||
Reference in New Issue
Block a user