作者 开飞机的舒克

接口优化

... ... @@ -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);
}
... ...
... ... @@ -5424,7 +5424,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-20 11:57:07 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-20 14:13:45 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...