refactoring compareThematiquePriority and in cas of equality sort by thematique alphabetical order
This commit is contained in:
parent
73014daa08
commit
c0e204310e
|
|
@ -128,12 +128,11 @@ function compareThematiquePriority($postA, $postB)
|
|||
$priorityA = $postA->thematique_priority ?? 0;
|
||||
$priorityB = $postB->thematique_priority ?? 0;
|
||||
|
||||
$thematiqueA = getPostMainThematique($postA);
|
||||
$thematiqueB = getPostMainThematique($postB);
|
||||
|
||||
if ($priorityA == $priorityB) {
|
||||
if ($postA->post_date > $postB->post_date) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
return strcmp($thematiqueA->name, $thematiqueB->name);
|
||||
}
|
||||
if ($priorityA < $priorityB) {
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user