作者 开飞机的舒克

根据活动筛选校区

@@ -46,13 +46,15 @@ class Activity extends Api @@ -46,13 +46,15 @@ class Activity extends Api
46 if (!$data) { 46 if (!$data) {
47 $this->error('当前还没有活动', ['status' => 2]); 47 $this->error('当前还没有活动', ['status' => 2]);
48 } 48 }
49 - $this->success('全部项目', $data); 49 + $this->success('全部活动', $data);
50 50
51 } 51 }
52 52
53 /** 53 /**
54 * @ApiTitle (项目校区) 54 * @ApiTitle (项目校区)
55 * @ApiMethod (POST) 55 * @ApiMethod (POST)
  56 + * @ApiParams (name="id", type="interge", required=true, description="活动id")
  57 + * @ApiParams (name="page", type="string", required=false, description="分页")
56 * @ApiReturnParams (name="code", type="integer", required=true, description="状态码") 58 * @ApiReturnParams (name="code", type="integer", required=true, description="状态码")
57 * @ApiReturnParams (name="msg", type="string", required=true, description="提示语") 59 * @ApiReturnParams (name="msg", type="string", required=true, description="提示语")
58 * @ApiReturnParams (name="data", type="object", description="扩展数据返回") 60 * @ApiReturnParams (name="data", type="object", description="扩展数据返回")
@@ -64,11 +66,13 @@ class Activity extends Api @@ -64,11 +66,13 @@ class Activity extends Api
64 */ 66 */
65 public function getSchoolItem() 67 public function getSchoolItem()
66 { 68 {
  69 + $param = $this->request->param();
67 $data = db('campus c') 70 $data = db('campus c')
68 ->join('activity a','a.id = c.activity_id') 71 ->join('activity a','a.id = c.activity_id')
69 ->join('school s','s.id = c.school_id') 72 ->join('school s','s.id = c.school_id')
70 ->field('c.*,a.title as activity_name,s.title as school_name') 73 ->field('c.*,a.title as activity_name,s.title as school_name')
71 - ->paginate(10,false); 74 + ->where('c.activity_id',$param['id'])
  75 + ->paginate(10,false,['page'=>$param['page']]);
72 if (empty($data)) { 76 if (empty($data)) {
73 $this->error('当前还没有校区', ['status' => 2]); 77 $this->error('当前还没有校区', ['status' => 2]);
74 } 78 }
@@ -2296,7 +2296,30 @@ @@ -2296,7 +2296,30 @@
2296 <div class="panel panel-default"> 2296 <div class="panel panel-default">
2297 <div class="panel-heading"><strong>参数</strong></div> 2297 <div class="panel-heading"><strong>参数</strong></div>
2298 <div class="panel-body"> 2298 <div class="panel-body">
2299 - 2299 + <table class="table table-hover">
  2300 + <thead>
  2301 + <tr>
  2302 + <th>名称</th>
  2303 + <th>类型</th>
  2304 + <th>必选</th>
  2305 + <th>描述</th>
  2306 + </tr>
  2307 + </thead>
  2308 + <tbody>
  2309 + <tr>
  2310 + <td>id</td>
  2311 + <td>interge</td>
  2312 + <td></td>
  2313 + <td>活动id</td>
  2314 + </tr>
  2315 + <tr>
  2316 + <td>page</td>
  2317 + <td>string</td>
  2318 + <td></td>
  2319 + <td>分页</td>
  2320 + </tr>
  2321 + </tbody>
  2322 + </table>
2300 </div> 2323 </div>
2301 </div> 2324 </div>
2302 <div class="panel panel-default"> 2325 <div class="panel panel-default">
@@ -2318,7 +2341,12 @@ @@ -2318,7 +2341,12 @@
2318 <div class="panel-body"> 2341 <div class="panel-body">
2319 <form enctype="application/x-www-form-urlencoded" role="form" action="/api/activity/getSchoolItem" method="POST" name="form1" id="form1"> 2342 <form enctype="application/x-www-form-urlencoded" role="form" action="/api/activity/getSchoolItem" method="POST" name="form1" id="form1">
2320 <div class="form-group"> 2343 <div class="form-group">
2321 - 2344 + <label class="control-label" for="id">id</label>
  2345 + <input type="interge" class="form-control input-sm" id="id" required placeholder="活动id" name="id">
  2346 + </div>
  2347 + <div class="form-group">
  2348 + <label class="control-label" for="page">page</label>
  2349 + <input type="string" class="form-control input-sm" id="page" placeholder="分页" name="page">
2322 </div> 2350 </div>
2323 <div class="form-group form-group-submit"> 2351 <div class="form-group form-group-submit">
2324 <button type="submit" class="btn btn-success send" rel="1">提交</button> 2352 <button type="submit" class="btn btn-success send" rel="1">提交</button>
@@ -5754,7 +5782,7 @@ @@ -5754,7 +5782,7 @@
5754 5782
5755 </div> 5783 </div>
5756 <div class="col-md-6" align="right"> 5784 <div class="col-md-6" align="right">
5757 - Generated on 2023-03-28 17:56:39 <a href="./" target="_blank">校园活动</a> 5785 + Generated on 2023-03-29 08:42:53 <a href="./" target="_blank">校园活动</a>
5758 </div> 5786 </div>
5759 </div> 5787 </div>
5760 5788