...
|
...
|
@@ -27,6 +27,7 @@ class Index extends Api |
|
|
"time": "时间戳",
|
|
|
"data": {
|
|
|
"id": '学生id',
|
|
|
"avatar": "头像",
|
|
|
"name": "学生姓名",
|
|
|
"score_num": "学生分数",
|
|
|
"rank": "排名"
|
...
|
...
|
@@ -49,16 +50,17 @@ class Index extends Api |
|
|
foreach ($data as $k => $v) {
|
|
|
if ($v['study_id'] == $sid['id']) {
|
|
|
$list['id'] = $sid['id'];
|
|
|
$list['avatar'] = cdnurl($sid['avatar'], true);
|
|
|
$list['name'] = $sid['name'];
|
|
|
$list['score_num'] = $v['sum_score'];
|
|
|
$list['rank'] = $k + 1;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (empty($list)){
|
|
|
if (empty($list)) {
|
|
|
$res = \db('study')
|
|
|
->where('user_id', $userinfo['id'])
|
|
|
->field('name,grade,school,earn_score')
|
|
|
->field('avatar,name,grade,school,earn_score')
|
|
|
->find();
|
|
|
$this->success('获取成功', $res);
|
|
|
}
|
...
|
...
|
|