Skip to content

Commit

Permalink
fix answer sort bug
Browse files Browse the repository at this point in the history
  • Loading branch information
swr1bm86 committed Apr 14, 2014
1 parent df55d09 commit 6f78c7d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SEUHome/Lib/Action/QuestionAction.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,14 @@ public function detail(){
$UltimateInfo = array_merge($AnswerInfo, $AnonymousInfo);
}

foreach ($UltimateInfo as $key => $value) {
$support_count[$key] = $value['support_count'];
$create_time[$key] = $value['create_time'];
}

array_multisort($support_count, $create_time, $UltimateInfo);
$UltimateInfo = array_reverse($UltimateInfo);

$this->assign('answers', $UltimateInfo);

//判断是否是当前用户关注的问题
Expand Down

0 comments on commit 6f78c7d

Please # to comment.