mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +01:00
Sort Ponder Answers by voteCount
Summary: Fixes T9207. I think this is correct? Sorts based on vote count and reverses the order of the array so higher is first. Test Plan: Test vote ordering on a number of sample tasks. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T9207 Differential Revision: https://secure.phabricator.com/D13924
This commit is contained in:
parent
ee8e436390
commit
bd0bbc713a
1 changed files with 2 additions and 1 deletions
|
@ -225,9 +225,10 @@ final class PonderQuestionViewController extends PonderController {
|
|||
$xaction_groups = mgroup($xactions, 'getObjectPHID');
|
||||
$author_phids = mpull($answers, 'getAuthorPHID');
|
||||
$handles = $this->loadViewerHandles($author_phids);
|
||||
$answers_sort = array_reverse(msort($answers, 'getVoteCount'));
|
||||
|
||||
$view = array();
|
||||
foreach ($answers as $answer) {
|
||||
foreach ($answers_sort as $answer) {
|
||||
$xactions = idx($xaction_groups, $answer->getPHID(), array());
|
||||
$id = $answer->getID();
|
||||
$handle = $handles[$answer->getAuthorPHID()];
|
||||
|
|
Loading…
Reference in a new issue