作者 开飞机的舒克

根据活动筛选校区

... ... @@ -46,13 +46,15 @@ class Activity extends Api
if (!$data) {
$this->error('当前还没有活动', ['status' => 2]);
}
$this->success('全部项目', $data);
$this->success('全部活动', $data);
}
/**
* @ApiTitle (项目校区)
* @ApiMethod (POST)
* @ApiParams (name="id", type="interge", required=true, description="活动id")
* @ApiParams (name="page", type="string", required=false, description="分页")
* @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
* @ApiReturnParams (name="msg", type="string", required=true, description="提示语")
* @ApiReturnParams (name="data", type="object", description="扩展数据返回")
... ... @@ -64,11 +66,13 @@ class Activity extends Api
*/
public function getSchoolItem()
{
$param = $this->request->param();
$data = db('campus c')
->join('activity a','a.id = c.activity_id')
->join('school s','s.id = c.school_id')
->field('c.*,a.title as activity_name,s.title as school_name')
->paginate(10,false);
->where('c.activity_id',$param['id'])
->paginate(10,false,['page'=>$param['page']]);
if (empty($data)) {
$this->error('当前还没有校区', ['status' => 2]);
}
... ...
... ... @@ -2296,7 +2296,30 @@
<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>id</td>
<td>interge</td>
<td></td>
<td>活动id</td>
</tr>
<tr>
<td>page</td>
<td>string</td>
<td></td>
<td>分页</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-default">
... ... @@ -2318,7 +2341,12 @@
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/activity/getSchoolItem" method="POST" name="form1" id="form1">
<div class="form-group">
<label class="control-label" for="id">id</label>
<input type="interge" class="form-control input-sm" id="id" required placeholder="活动id" name="id">
</div>
<div class="form-group">
<label class="control-label" for="page">page</label>
<input type="string" class="form-control input-sm" id="page" placeholder="分页" name="page">
</div>
<div class="form-group form-group-submit">
<button type="submit" class="btn btn-success send" rel="1">提交</button>
... ... @@ -5754,7 +5782,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-03-28 17:56:39 <a href="./" target="_blank">校园活动</a>
Generated on 2023-03-29 08:42:53 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...