|
@@ -104,7 +104,24 @@ class RankingList extends Command
|
|
|
foreach ($release_best_author as $k => $v) {
|
|
|
$release_best_author[$k]['type'] = 'release';
|
|
|
}
|
|
|
- $all_best_author = array_merge($comment_best_author, $general_best_author, $release_best_author);
|
|
|
+ $best_author = array_merge($comment_best_author, $general_best_author, $release_best_author);
|
|
|
+
|
|
|
+ $result = [];
|
|
|
+ foreach ($best_author as $key => $val) {
|
|
|
+ if (isset($result[$val['content_author_id']]) && isset($result[$val['content_author_id']]['num'])) {
|
|
|
+ $result[$val['content_author_id']]['num'] += $val['num'];
|
|
|
+ } else {
|
|
|
+ $result[$val['content_author_id']]['num'] = $val['num'];
|
|
|
+ }
|
|
|
+ if (isset($result[$val['content_author_id']]) && isset($result[$val['content_author_id']]['count'])) {
|
|
|
+ $result[$val['content_author_id']]['count'] += $val['count'];
|
|
|
+ } else {
|
|
|
+ $result[$val['content_author_id']]['count'] = $val['count'];
|
|
|
+ }
|
|
|
+ $result[$val['content_author_id']]['content_author_id'] = $val['content_author_id'];
|
|
|
+ }
|
|
|
+
|
|
|
+ $all_best_author = array_merge($result);
|
|
|
|
|
|
$column = array_column($all_best_author, 'count');
|
|
|
array_multisort($column, SORT_DESC, $all_best_author);
|