作者 开飞机的舒克

接口优化

... ... @@ -78,7 +78,7 @@ class Activity extends Api
/**
* @ApiTitle (场次筛选)
* @ApiMethod (POST)
* @ApiParams (name="id", type="string", required=false, description="校区id")
* @ApiParams (name="cid", type="string", required=false, description="校区id")
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
* @ApiReturnParams (name="msg", type="string", required=true, description="提示语")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
... ... @@ -94,14 +94,14 @@ class Activity extends Api
*/
public function getRonda()
{
$id = $this->request->param('id');
$cid = $this->request->param('cid');
if (empty($id)) {
$this->error('参数错误', ['status' => 2]);
}
$data = db('ronda r')
->join('campus c','c.id = r.campus_id')
->field('c.title as campus_title,r.title as ronda_title,r.holdtime as ronda_holdtime,r.id')
->where('r.campus_id',$id)
->field('r.id as rid,c.title as campus_title,r.title as ronda_title,r.holdtime as ronda_holdtime')
->where('r.campus_id',$cid)
->paginate(10,false);
$this->success('获取场次列表成功', $data);
}
... ... @@ -109,7 +109,7 @@ class Activity extends Api
/**
* @ApiTitle (项目筛选)
* @ApiMethod (POST)
* @ApiParams (name="id", type="string", required=false, description="场次id")
* @ApiParams (name="rid", type="string", required=false, description="场次id")
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
* @ApiReturnParams (name="msg", type="string", required=true, description="提示语")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
... ... @@ -125,7 +125,7 @@ class Activity extends Api
*/
public function getItem()
{
$id = $this->request->param('id');
$rid = $this->request->param('rid');
if (empty($id)) {
$this->error('参数错误', ['status' => 2]);
}
... ... @@ -134,7 +134,7 @@ class Activity extends Api
->join('campus c','r.campus_id as c.id')
->field('i.*,c.title as campus_title')
->where([
'i.ronda_id' => $id
'i.ronda_id' => $rid
])
->paginate(10,false);
$this->success('获取项目列表成功', $data);
... ... @@ -143,7 +143,7 @@ class Activity extends Api
/**
* @ApiTitle (场次详情)
* @ApiMethod (POST)
* @ApiParams (name="id", type="string", required=false, description="场次id")
* @ApiParams (name="rid", type="string", required=false, description="场次id")
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
* @ApiReturnParams (name="msg", type="string", required=true, description="提示语")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
... ... @@ -157,9 +157,9 @@ class Activity extends Api
*/
public function getRondaDetails()
{
$id = $this->request->param('id');
$rid = $this->request->param('rid');
$data = db('ronda')
->where('id', $id)
->where('id', $rid)
->find();
$data['images'] = cdnurl($data['images'], true);
$this->success('获取场次详情成功', $data);
... ...
... ... @@ -2127,7 +2127,7 @@
</thead>
<tbody>
<tr>
<td>id</td>
<td>cid</td>
<td>string</td>
<td></td>
<td>校区id</td>
... ... @@ -2155,8 +2155,8 @@
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/activity/getRonda" method="POST" name="form2" id="form2">
<div class="form-group">
<label class="control-label" for="id">id</label>
<input type="string" class="form-control input-sm" id="id" placeholder="校区id" name="id">
<label class="control-label" for="cid">cid</label>
<input type="string" class="form-control input-sm" id="cid" placeholder="校区id" name="cid">
</div>
<div class="form-group form-group-submit">
<button type="submit" class="btn btn-success send" rel="2">提交</button>
... ... @@ -2291,7 +2291,7 @@
</thead>
<tbody>
<tr>
<td>id</td>
<td>rid</td>
<td>string</td>
<td></td>
<td>场次id</td>
... ... @@ -2319,8 +2319,8 @@
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/activity/getItem" method="POST" name="form3" id="form3">
<div class="form-group">
<label class="control-label" for="id">id</label>
<input type="string" class="form-control input-sm" id="id" placeholder="场次id" name="id">
<label class="control-label" for="rid">rid</label>
<input type="string" class="form-control input-sm" id="rid" placeholder="场次id" name="rid">
</div>
<div class="form-group form-group-submit">
<button type="submit" class="btn btn-success send" rel="3">提交</button>
... ... @@ -2455,7 +2455,7 @@
</thead>
<tbody>
<tr>
<td>id</td>
<td>rid</td>
<td>string</td>
<td></td>
<td>场次id</td>
... ... @@ -2483,8 +2483,8 @@
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/activity/getRondaDetails" method="POST" name="form4" id="form4">
<div class="form-group">
<label class="control-label" for="id">id</label>
<input type="string" class="form-control input-sm" id="id" placeholder="场次id" name="id">
<label class="control-label" for="rid">rid</label>
<input type="string" class="form-control input-sm" id="rid" placeholder="场次id" name="rid">
</div>
<div class="form-group form-group-submit">
<button type="submit" class="btn btn-success send" rel="4">提交</button>
... ... @@ -5200,7 +5200,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-17 13:46:22 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-17 13:49:30 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...