作者 开飞机的舒克

更新大屏接口

... ... @@ -34,7 +34,6 @@ class Activity extends Api
/**
* @ApiTitle (项目校区)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="id", type="string", required=false, description="活动id")
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
* @ApiReturnParams (name="msg", type="string", required=true, description="提示语")
... ... @@ -85,13 +84,8 @@ class Activity extends Api
public function getItemRonda()
{
$id = $this->request->param('id');
$data['school_name'] = db('school s')
->join('activity a','s.activity_id = a.id')
->field('s.*,a.title as activity_name')
->where('s.id', $id)
->find();
$data['ronda'] = db('ronda')
->where('xq_id', $id)
->where('campus_id', $id)
->paginate(10)
->each(function ($item, $k) {
$data['item'] = db('item')->where('ronda_id', $item['id'])->find();
... ...
... ... @@ -22,7 +22,7 @@ class Index extends Api
* @ApiTitle (首页)
* @ApiMethod (POST)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="xq", type="string", required=true, description="校区id[必填]")
* @ApiParams (name="campus", type="string", required=true, description="校区id[必填]")
* @ApiParams (name="row", type="string", required=false, description="每页显示行数[非必填]")
* @ApiParams (name="page", type="string", required=false, description="当前页[非必填]")
* @ApiReturn ({"code":状态码,
... ... @@ -46,12 +46,12 @@ class Index extends Api
*/
public function index()
{
$xq = $this->request->param('xq');
$campus = $this->request->param('campus');
$row = $this->request->param('row');
$page = $this->request->param('page');
$row = $row ? $row : 10;
$page = $page ? $page : 1;
if (empty($xq)) {
if (empty($campus)) {
$this->error('参数错误', ['status' => 2]);
}
$userinfo = $this->auth->getUserinfo();
... ... @@ -59,7 +59,7 @@ class Index extends Api
//个人排行榜
$data = \db('study_score_log')
->field('id,SUM(score) as sum_score,study_id')
->where('school_id', $xq)
->where('campus_id', $campus)
->group('study_id')
->order('sum_score DESC')
->paginate($row, false, ['page' => $page])
... ... @@ -68,7 +68,7 @@ class Index extends Api
return $item;
});
$data['active_study_score'] = \db('study_score_log')
->where(['study_id' => $sid, 'school_id' => $xq])
->where(['study_id' => $sid, 'campus_id' => $campus])
->sum('score');
$data['active_study_info'] = \db('study')->where('id', $sid)->value('name');
$this->success('获取成功', [$data, 'status' => 1]);
... ... @@ -118,7 +118,7 @@ class Index extends Api
* @ApiTitle (战队排行榜)
* @ApiMethod (POST)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="xq", type="string", required=true, description="校区id[必填]")
* @ApiParams (name="campus", type="string", required=true, description="校区id[必填]")
* @ApiParams (name="row", type="string", required=false, description="每页显示行数[非必填]")
* @ApiParams (name="page", type="string", required=false, description="当前页[非必填]")
* @ApiReturn ({"code":状态码,
... ... @@ -146,14 +146,14 @@ class Index extends Api
$page = $this->request->param('page');
$row = $row ? $row : 10;
$page = $page ? $page : 1;
$xq = $this->request->param('xq');
if (empty($xq)) {
$campus = $this->request->param('campus');
if (empty($campus)) {
$this->error('参数错误', ['status' => 2]);
}
$data = \db('study_score_log l')
->distinct('l.team_id')
->join('team t', 't.id = l.team_id')
->where('l.school_id', $xq)
->where('l.campus_id', $campus)
->field('t.title,t.score,l.team_id')
->order('t.score DESC')
->paginate($row, false, ['page' => $page]);
... ... @@ -165,7 +165,7 @@ class Index extends Api
* @ApiTitle (个人排行榜)
* @ApiMethod (POST)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiParams (name="xq", type="string", required=true, description="校区id[必填]")
* @ApiParams (name="campus", type="string", required=true, description="校区id[必填]")
* @ApiParams (name="row", type="string", required=false, description="每页显示行数[非必填]")
* @ApiParams (name="page", type="string", required=false, description="当前页[非必填]")
* @ApiReturn ({"code":状态码,
... ... @@ -187,19 +187,19 @@ class Index extends Api
*/
public function personRank()
{
$xq = $this->request->param('xq');
$campus = $this->request->param('campus');
$row = $this->request->param('row');
$page = $this->request->param('page');
$user = $this->auth->getUserinfo();
$row = $row ? $row : 10;
$page = $page ? $page : 1;
if (empty($xq)) {
if (empty($campus)) {
$this->error('参数错误', ['status' => 2]);
}
//个人排行榜
$data = \db('study_score_log')
->field('id,SUM(score) as sum_score,study_id')
->where('school_id', $xq)
->where('campus_id', $campus)
->group('study_id')
->order('sum_score DESC')
->paginate($row, false, ['page' => $page])
... ...
... ... @@ -16,7 +16,6 @@ class Screen extends Api
/**
* @ApiTitle (大屏管理)
* @ApiMethod (POST)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
* @ApiReturn ({"code":状态码,
"msg":"提示信息"
"time": "时间戳",
... ...
... ... @@ -3356,53 +3356,13 @@
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>token</td>
<td>string</td>
<td></td>
<td>请求的Token</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong></div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>名称</th>
<th>类型</th>
<th>必选</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>xq</td>
<td>string</td>
<td></td>
<td>校区id[必填]</td>
</tr>
<tr>
<td>hd</td>
<td>string</td>
<td></td>
<td>活动id[必填]</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
... ... @@ -3416,17 +3376,6 @@
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading"><strong>Headers</strong></div>
<div class="panel-body">
<div class="headers">
<div class="form-group">
<label class="control-label" for="token">token</label>
<input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token">
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading"><strong>参数</strong>
<div class="pull-right">
<a href="javascript:" class="btn btn-xs btn-info btn-append">追加</a>
... ... @@ -3435,12 +3384,7 @@
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/screen/index" method="POST" name="form17" id="form17">
<div class="form-group">
<label class="control-label" for="xq">xq</label>
<input type="string" class="form-control input-sm" id="xq" required placeholder="校区id[必填]" name="xq">
</div>
<div class="form-group">
<label class="control-label" for="hd">hd</label>
<input type="string" class="form-control input-sm" id="hd" required placeholder="活动id[必填]" name="hd">
</div>
<div class="form-group form-group-submit">
<button type="submit" class="btn btn-success send" rel="17">提交</button>
... ... @@ -3483,7 +3427,6 @@
"starttime": 校区活动开始时间,
"endtime": 校区活动结束时间,
"is_view": 是否展示,
"hd_name": "活动名称",
"createtime": 创建时间,
"updatetime": 更新时间,
"count_down": "倒计时",
... ... @@ -3497,7 +3440,7 @@
"title": "坦克战队",
"score": "13.00",
"team_id": 1,
"study": 战队个人排行{
"study": 战队个人排行{
"data": [{
"name": "李四",
"earn_score": "12.00"
... ... @@ -4620,7 +4563,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-09 13:41:34 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-09 15:44:57 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...