We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 69caed1 + 8e6cb0f commit e42511aCopy full SHA for e42511a
app/Livewire/Conducting/StudySelection/PaperModal.php
@@ -48,7 +48,16 @@ public function showPaper($paper, $criterias)
48
49
$this->canEdit = $this->userCanEdit();
50
51
- $this->criterias = $criterias;
+ // 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
+
61
$this->paper = $paper;
62
63
$databaseName = DB::table('data_base')
0 commit comments