Skip to content

Commit e42511a

Browse files
authored
Merge pull request #732 from Thoth2023/develop
Develop
2 parents 69caed1 + 8e6cb0f commit e42511a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

app/Livewire/Conducting/StudySelection/PaperModal.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,16 @@ public function showPaper($paper, $criterias)
4848

4949
$this->canEdit = $this->userCanEdit();
5050

51-
$this->criterias = $criterias;
51+
// Ordenar critérios: Inclusion primeiro (ordenado por ID), depois Exclusion (ordenado por ID)
52+
$this->criterias = collect($criterias)
53+
->sortBy([
54+
fn ($a, $b) => $a['type'] === $b['type']
55+
? strnatcmp($a['id'], $b['id'])
56+
: ($a['type'] === 'Inclusion' ? -1 : 1),
57+
])
58+
->values()
59+
->toArray();
60+
5261
$this->paper = $paper;
5362

5463
$databaseName = DB::table('data_base')

0 commit comments

Comments
 (0)