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;
|
$priorityA = $postA->thematique_priority ?? 0;
|
||||||
$priorityB = $postB->thematique_priority ?? 0;
|
$priorityB = $postB->thematique_priority ?? 0;
|
||||||
|
|
||||||
|
$thematiqueA = getPostMainThematique($postA);
|
||||||
|
$thematiqueB = getPostMainThematique($postB);
|
||||||
|
|
||||||
if ($priorityA == $priorityB) {
|
if ($priorityA == $priorityB) {
|
||||||
if ($postA->post_date > $postB->post_date) {
|
return strcmp($thematiqueA->name, $thematiqueB->name);
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($priorityA < $priorityB) {
|
if ($priorityA < $priorityB) {
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user