浏览代码

完善排行榜

15954078560 2 年之前
父节点
当前提交
4a3c6cc8ba
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      application/api/controller/Index.php

+ 2 - 1
application/api/controller/Index.php

@@ -1584,9 +1584,10 @@ class Index extends Api
         $list = list_domain_image($list, ['avatar']);
         if ($list) {
             $hu_rank = Db::name('rank');
-            foreach ($list as &$v) {
+            foreach ($list as $k => &$v) {
                 $rank_name = $hu_rank->where(['id' => $v['rank_id']])->value('name');
                 $v['rank_name'] = $rank_name ? : '';
+                $v['rank'] = $this->page * $this->pagenum + $k + 1;
             }
         }