正在显示
3 个修改的文件
包含
44 行增加
和
92 行删除
@@ -64,7 +64,6 @@ class Activity extends Api | @@ -64,7 +64,6 @@ class Activity extends Api | ||
64 | 64 | ||
65 | /** | 65 | /** |
66 | * @ApiTitle (项目日期场次) | 66 | * @ApiTitle (项目日期场次) |
67 | - * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") | ||
68 | * @ApiParams (name="id", type="string", required=false, description="校区id") | 67 | * @ApiParams (name="id", type="string", required=false, description="校区id") |
69 | * @ApiReturnParams (name="code", type="integer", required=true, description="状态码") | 68 | * @ApiReturnParams (name="code", type="integer", required=true, description="状态码") |
70 | * @ApiReturnParams (name="msg", type="string", required=true, description="提示语") | 69 | * @ApiReturnParams (name="msg", type="string", required=true, description="提示语") |
@@ -83,14 +82,23 @@ class Activity extends Api | @@ -83,14 +82,23 @@ class Activity extends Api | ||
83 | */ | 82 | */ |
84 | public function getItemRonda() | 83 | public function getItemRonda() |
85 | { | 84 | { |
85 | + $row = $this->request->param('row'); | ||
86 | + $page = $this->request->param('page'); | ||
87 | + $row = $row ? $row : 10; | ||
88 | + $page = $page ? $page : 1; | ||
86 | $id = $this->request->param('id'); | 89 | $id = $this->request->param('id'); |
87 | - $data['ronda'] = db('ronda') | ||
88 | - ->where('campus_id', $id) | ||
89 | - ->paginate(10) | ||
90 | - ->each(function ($item, $k) { | ||
91 | - $data['item'] = db('item')->where('ronda_id', $item['id'])->find(); | ||
92 | - $data['item_details'] = db('item_details')->where('item_id', $data['item']['id'])->find(); | ||
93 | - return $data; | 90 | + if (empty($id)) { |
91 | + $this->error('参数错误', ['status' => 2]); | ||
92 | + } | ||
93 | + $data = db('item_ronda_rel') | ||
94 | + ->field('campus_id,ronda_id,item_id') | ||
95 | + ->where('campus_id',$id) | ||
96 | + ->paginate($row,false,['page'=>$page]) | ||
97 | + ->each(function ($item,$key){ | ||
98 | + $item['ronda'] = db('ronda')->where('id',$item['ronda_id'])->field('title,holdtime')->find(); | ||
99 | + $item['item'] = db('item')->where('id',$item['item_id'])->value('title'); | ||
100 | + $item['item_details'] = db('item_details')->where('item_id',$item['item_id'])->field('images,details')->find(); | ||
101 | + return $item; | ||
94 | }); | 102 | }); |
95 | $this->success('项目场次日期', $data); | 103 | $this->success('项目场次日期', $data); |
96 | } | 104 | } |
@@ -110,7 +110,7 @@ class Bind extends Api | @@ -110,7 +110,7 @@ class Bind extends Api | ||
110 | * @ApiTitle (活动现场[扫码]) | 110 | * @ApiTitle (活动现场[扫码]) |
111 | * @ApiMethod (POST) | 111 | * @ApiMethod (POST) |
112 | * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") | 112 | * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") |
113 | - * @ApiParams (name="xm", type="string", required=true, description="项目id") | 113 | + * @ApiParams (name="items_id", type="string", required=true, description="项目id") |
114 | * @ApiParams (name="unique", type="string", required=true, description="条形码唯一标识") | 114 | * @ApiParams (name="unique", type="string", required=true, description="条形码唯一标识") |
115 | * @ApiReturn ({ | 115 | * @ApiReturn ({ |
116 | "code":"状态码", | 116 | "code":"状态码", |
@@ -123,22 +123,22 @@ class Bind extends Api | @@ -123,22 +123,22 @@ class Bind extends Api | ||
123 | }) | 123 | }) |
124 | */ | 124 | */ |
125 | public function Ewm(){ | 125 | public function Ewm(){ |
126 | - $xm = $this->request->param('xm'); | 126 | + $items_id = $this->request->param('items_id'); |
127 | $unique = $this->request->param('unique'); | 127 | $unique = $this->request->param('unique'); |
128 | - if (empty($unique) && empty($xm)){ | 128 | + if (empty($unique) && empty($items_id)){ |
129 | $this->error('参数错误',['status'=>2]); | 129 | $this->error('参数错误',['status'=>2]); |
130 | } | 130 | } |
131 | $study = db('study')->where('unique',$unique)->field('id,grade,name,sno,team_id,earn_score')->find(); | 131 | $study = db('study')->where('unique',$unique)->field('id,grade,name,sno,team_id,earn_score')->find(); |
132 | - $item = db('item')->where('id',$xm)->field('score,title,ronda_id')->find(); | ||
133 | - $xq_id = \db('ronda')->where('id',$item['ronda_id'])->value('xq_id'); | 132 | + $rel = \db('item_ronda_rel')->where('item_id',$items_id)->find(); |
133 | + $item = db('item')->where('id',$rel['item_id'])->field('score,title')->find(); | ||
134 | $team = \db('team')->where('id',$study['team_id'])->field('title,score')->find(); | 134 | $team = \db('team')->where('id',$study['team_id'])->field('title,score')->find(); |
135 | $sum1 = $team['score'] + $item['score']; //合计战队总分 | 135 | $sum1 = $team['score'] + $item['score']; //合计战队总分 |
136 | $sum2 = $study['earn_score'] + $item['score']; //合计个人总分 | 136 | $sum2 = $study['earn_score'] + $item['score']; //合计个人总分 |
137 | Db::startTrans(); | 137 | Db::startTrans(); |
138 | try { | 138 | try { |
139 | db('study_score_log')->insert([ | 139 | db('study_score_log')->insert([ |
140 | - 'item_id'=>$xm, | ||
141 | - 'school_id'=>$xq_id, | 140 | + 'item_id'=>$items_id, |
141 | + 'campus_id'=>$rel['campus_id'], | ||
142 | 'study_id'=>$study['id'], | 142 | 'study_id'=>$study['id'], |
143 | 'team_id'=>$study['team_id'], | 143 | 'team_id'=>$study['team_id'], |
144 | 'score'=>$item['score'], | 144 | 'score'=>$item['score'], |
@@ -169,7 +169,7 @@ class Bind extends Api | @@ -169,7 +169,7 @@ class Bind extends Api | ||
169 | * @ApiTitle (获取学生信息) | 169 | * @ApiTitle (获取学生信息) |
170 | * @ApiMethod (POST) | 170 | * @ApiMethod (POST) |
171 | * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") | 171 | * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") |
172 | - * @ApiParams (name="xq", type="string", required=true, description="校区id") | 172 | + * @ApiParams (name="campus_id", type="string", required=true, description="校区id") |
173 | * @ApiReturn ({ | 173 | * @ApiReturn ({ |
174 | "code":"状态码", | 174 | "code":"状态码", |
175 | "msg": "提示消息", | 175 | "msg": "提示消息", |
@@ -199,7 +199,7 @@ class Bind extends Api | @@ -199,7 +199,7 @@ class Bind extends Api | ||
199 | */ | 199 | */ |
200 | public function getScore(){ | 200 | public function getScore(){ |
201 | $user = $this->auth->getUserinfo(); | 201 | $user = $this->auth->getUserinfo(); |
202 | - $xq = $this->request->param('xq'); | 202 | + $campus_id = $this->request->param('campus_id'); |
203 | $sid = \db('study')->where('user_id',$user['id'])->value('id'); | 203 | $sid = \db('study')->where('user_id',$user['id'])->value('id'); |
204 | //获取学生的信息 | 204 | //获取学生的信息 |
205 | $data['study_info'] = \db('study')->where('id',$sid)->field('avatar,name,earn_score')->find(); | 205 | $data['study_info'] = \db('study')->where('id',$sid)->field('avatar,name,earn_score')->find(); |
@@ -208,7 +208,7 @@ class Bind extends Api | @@ -208,7 +208,7 @@ class Bind extends Api | ||
208 | ->distinct('item_id') | 208 | ->distinct('item_id') |
209 | ->field('item_id,SUM(score) as sum_score') | 209 | ->field('item_id,SUM(score) as sum_score') |
210 | ->group('item_id') | 210 | ->group('item_id') |
211 | - ->where(['school_id'=>$xq,'study_id'=>$sid]) | 211 | + ->where(['campus_id'=>$campus_id,'study_id'=>$sid]) |
212 | ->paginate(3,false) | 212 | ->paginate(3,false) |
213 | ->each(function ($item,$key){ | 213 | ->each(function ($item,$key){ |
214 | $item['item_ronda'] = \db('item i') | 214 | $item['item_ronda'] = \db('item i') |
@@ -1097,7 +1097,7 @@ | @@ -1097,7 +1097,7 @@ | ||
1097 | </thead> | 1097 | </thead> |
1098 | <tbody> | 1098 | <tbody> |
1099 | <tr> | 1099 | <tr> |
1100 | - <td>xq</td> | 1100 | + <td>campus</td> |
1101 | <td>string</td> | 1101 | <td>string</td> |
1102 | <td>是</td> | 1102 | <td>是</td> |
1103 | <td>校区id[必填]</td> | 1103 | <td>校区id[必填]</td> |
@@ -1148,8 +1148,8 @@ | @@ -1148,8 +1148,8 @@ | ||
1148 | <div class="panel-body"> | 1148 | <div class="panel-body"> |
1149 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/index" method="POST" name="form13" id="form13"> | 1149 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/index" method="POST" name="form13" id="form13"> |
1150 | <div class="form-group"> | 1150 | <div class="form-group"> |
1151 | - <label class="control-label" for="xq">xq</label> | ||
1152 | - <input type="string" class="form-control input-sm" id="xq" required placeholder="校区id[必填]" name="xq"> | 1151 | + <label class="control-label" for="campus">campus</label> |
1152 | + <input type="string" class="form-control input-sm" id="campus" required placeholder="校区id[必填]" name="campus"> | ||
1153 | </div> | 1153 | </div> |
1154 | <div class="form-group"> | 1154 | <div class="form-group"> |
1155 | <label class="control-label" for="row">row</label> | 1155 | <label class="control-label" for="row">row</label> |
@@ -1465,7 +1465,7 @@ | @@ -1465,7 +1465,7 @@ | ||
1465 | </thead> | 1465 | </thead> |
1466 | <tbody> | 1466 | <tbody> |
1467 | <tr> | 1467 | <tr> |
1468 | - <td>xq</td> | 1468 | + <td>campus</td> |
1469 | <td>string</td> | 1469 | <td>string</td> |
1470 | <td>是</td> | 1470 | <td>是</td> |
1471 | <td>校区id[必填]</td> | 1471 | <td>校区id[必填]</td> |
@@ -1516,8 +1516,8 @@ | @@ -1516,8 +1516,8 @@ | ||
1516 | <div class="panel-body"> | 1516 | <div class="panel-body"> |
1517 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/teamRank" method="POST" name="form15" id="form15"> | 1517 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/teamRank" method="POST" name="form15" id="form15"> |
1518 | <div class="form-group"> | 1518 | <div class="form-group"> |
1519 | - <label class="control-label" for="xq">xq</label> | ||
1520 | - <input type="string" class="form-control input-sm" id="xq" required placeholder="校区id[必填]" name="xq"> | 1519 | + <label class="control-label" for="campus">campus</label> |
1520 | + <input type="string" class="form-control input-sm" id="campus" required placeholder="校区id[必填]" name="campus"> | ||
1521 | </div> | 1521 | </div> |
1522 | <div class="form-group"> | 1522 | <div class="form-group"> |
1523 | <label class="control-label" for="row">row</label> | 1523 | <label class="control-label" for="row">row</label> |
@@ -1661,7 +1661,7 @@ | @@ -1661,7 +1661,7 @@ | ||
1661 | </thead> | 1661 | </thead> |
1662 | <tbody> | 1662 | <tbody> |
1663 | <tr> | 1663 | <tr> |
1664 | - <td>xq</td> | 1664 | + <td>campus</td> |
1665 | <td>string</td> | 1665 | <td>string</td> |
1666 | <td>是</td> | 1666 | <td>是</td> |
1667 | <td>校区id[必填]</td> | 1667 | <td>校区id[必填]</td> |
@@ -1712,8 +1712,8 @@ | @@ -1712,8 +1712,8 @@ | ||
1712 | <div class="panel-body"> | 1712 | <div class="panel-body"> |
1713 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/personRank" method="POST" name="form16" id="form16"> | 1713 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/index/personRank" method="POST" name="form16" id="form16"> |
1714 | <div class="form-group"> | 1714 | <div class="form-group"> |
1715 | - <label class="control-label" for="xq">xq</label> | ||
1716 | - <input type="string" class="form-control input-sm" id="xq" required placeholder="校区id[必填]" name="xq"> | 1715 | + <label class="control-label" for="campus">campus</label> |
1716 | + <input type="string" class="form-control input-sm" id="campus" required placeholder="校区id[必填]" name="campus"> | ||
1717 | </div> | 1717 | </div> |
1718 | <div class="form-group"> | 1718 | <div class="form-group"> |
1719 | <label class="control-label" for="row">row</label> | 1719 | <label class="control-label" for="row">row</label> |
@@ -1936,24 +1936,7 @@ | @@ -1936,24 +1936,7 @@ | ||
1936 | <div class="panel panel-default"> | 1936 | <div class="panel panel-default"> |
1937 | <div class="panel-heading"><strong>Headers</strong></div> | 1937 | <div class="panel-heading"><strong>Headers</strong></div> |
1938 | <div class="panel-body"> | 1938 | <div class="panel-body"> |
1939 | - <table class="table table-hover"> | ||
1940 | - <thead> | ||
1941 | - <tr> | ||
1942 | - <th>名称</th> | ||
1943 | - <th>类型</th> | ||
1944 | - <th>必选</th> | ||
1945 | - <th>描述</th> | ||
1946 | - </tr> | ||
1947 | - </thead> | ||
1948 | - <tbody> | ||
1949 | - <tr> | ||
1950 | - <td>token</td> | ||
1951 | - <td>string</td> | ||
1952 | - <td>是</td> | ||
1953 | - <td>请求的Token</td> | ||
1954 | - </tr> | ||
1955 | - </tbody> | ||
1956 | - </table> | 1939 | + 无 |
1957 | </div> | 1940 | </div> |
1958 | </div> | 1941 | </div> |
1959 | <div class="panel panel-default"> | 1942 | <div class="panel panel-default"> |
@@ -1990,17 +1973,6 @@ | @@ -1990,17 +1973,6 @@ | ||
1990 | <div class="row"> | 1973 | <div class="row"> |
1991 | <div class="col-md-12"> | 1974 | <div class="col-md-12"> |
1992 | <div class="panel panel-default"> | 1975 | <div class="panel panel-default"> |
1993 | - <div class="panel-heading"><strong>Headers</strong></div> | ||
1994 | - <div class="panel-body"> | ||
1995 | - <div class="headers"> | ||
1996 | - <div class="form-group"> | ||
1997 | - <label class="control-label" for="token">token</label> | ||
1998 | - <input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token"> | ||
1999 | - </div> | ||
2000 | - </div> | ||
2001 | - </div> | ||
2002 | - </div> | ||
2003 | - <div class="panel panel-default"> | ||
2004 | <div class="panel-heading"><strong>参数</strong> | 1976 | <div class="panel-heading"><strong>参数</strong> |
2005 | <div class="pull-right"> | 1977 | <div class="pull-right"> |
2006 | <a href="javascript:" class="btn btn-xs btn-info btn-append">追加</a> | 1978 | <a href="javascript:" class="btn btn-xs btn-info btn-append">追加</a> |
@@ -2124,24 +2096,7 @@ | @@ -2124,24 +2096,7 @@ | ||
2124 | <div class="panel panel-default"> | 2096 | <div class="panel panel-default"> |
2125 | <div class="panel-heading"><strong>Headers</strong></div> | 2097 | <div class="panel-heading"><strong>Headers</strong></div> |
2126 | <div class="panel-body"> | 2098 | <div class="panel-body"> |
2127 | - <table class="table table-hover"> | ||
2128 | - <thead> | ||
2129 | - <tr> | ||
2130 | - <th>名称</th> | ||
2131 | - <th>类型</th> | ||
2132 | - <th>必选</th> | ||
2133 | - <th>描述</th> | ||
2134 | - </tr> | ||
2135 | - </thead> | ||
2136 | - <tbody> | ||
2137 | - <tr> | ||
2138 | - <td>token</td> | ||
2139 | - <td>string</td> | ||
2140 | - <td>是</td> | ||
2141 | - <td>请求的Token</td> | ||
2142 | - </tr> | ||
2143 | - </tbody> | ||
2144 | - </table> | 2099 | + 无 |
2145 | </div> | 2100 | </div> |
2146 | </div> | 2101 | </div> |
2147 | <div class="panel panel-default"> | 2102 | <div class="panel panel-default"> |
@@ -2178,17 +2133,6 @@ | @@ -2178,17 +2133,6 @@ | ||
2178 | <div class="row"> | 2133 | <div class="row"> |
2179 | <div class="col-md-12"> | 2134 | <div class="col-md-12"> |
2180 | <div class="panel panel-default"> | 2135 | <div class="panel panel-default"> |
2181 | - <div class="panel-heading"><strong>Headers</strong></div> | ||
2182 | - <div class="panel-body"> | ||
2183 | - <div class="headers"> | ||
2184 | - <div class="form-group"> | ||
2185 | - <label class="control-label" for="token">token</label> | ||
2186 | - <input type="string" class="form-control input-sm" id="token" required placeholder="请求的Token - Ex: " name="token"> | ||
2187 | - </div> | ||
2188 | - </div> | ||
2189 | - </div> | ||
2190 | - </div> | ||
2191 | - <div class="panel panel-default"> | ||
2192 | <div class="panel-heading"><strong>参数</strong> | 2136 | <div class="panel-heading"><strong>参数</strong> |
2193 | <div class="pull-right"> | 2137 | <div class="pull-right"> |
2194 | <a href="javascript:" class="btn btn-xs btn-info btn-append">追加</a> | 2138 | <a href="javascript:" class="btn btn-xs btn-info btn-append">追加</a> |
@@ -3027,7 +2971,7 @@ | @@ -3027,7 +2971,7 @@ | ||
3027 | </thead> | 2971 | </thead> |
3028 | <tbody> | 2972 | <tbody> |
3029 | <tr> | 2973 | <tr> |
3030 | - <td>xm</td> | 2974 | + <td>items_id</td> |
3031 | <td>string</td> | 2975 | <td>string</td> |
3032 | <td>是</td> | 2976 | <td>是</td> |
3033 | <td>项目id</td> | 2977 | <td>项目id</td> |
@@ -3072,8 +3016,8 @@ | @@ -3072,8 +3016,8 @@ | ||
3072 | <div class="panel-body"> | 3016 | <div class="panel-body"> |
3073 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/bind/Ewm" method="POST" name="form7" id="form7"> | 3017 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/bind/Ewm" method="POST" name="form7" id="form7"> |
3074 | <div class="form-group"> | 3018 | <div class="form-group"> |
3075 | - <label class="control-label" for="xm">xm</label> | ||
3076 | - <input type="string" class="form-control input-sm" id="xm" required placeholder="项目id" name="xm"> | 3019 | + <label class="control-label" for="items_id">items_id</label> |
3020 | + <input type="string" class="form-control input-sm" id="items_id" required placeholder="项目id" name="items_id"> | ||
3077 | </div> | 3021 | </div> |
3078 | <div class="form-group"> | 3022 | <div class="form-group"> |
3079 | <label class="control-label" for="unique">unique</label> | 3023 | <label class="control-label" for="unique">unique</label> |
@@ -3204,7 +3148,7 @@ | @@ -3204,7 +3148,7 @@ | ||
3204 | </thead> | 3148 | </thead> |
3205 | <tbody> | 3149 | <tbody> |
3206 | <tr> | 3150 | <tr> |
3207 | - <td>xq</td> | 3151 | + <td>campus_id</td> |
3208 | <td>string</td> | 3152 | <td>string</td> |
3209 | <td>是</td> | 3153 | <td>是</td> |
3210 | <td>校区id</td> | 3154 | <td>校区id</td> |
@@ -3243,8 +3187,8 @@ | @@ -3243,8 +3187,8 @@ | ||
3243 | <div class="panel-body"> | 3187 | <div class="panel-body"> |
3244 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/bind/getScore" method="POST" name="form8" id="form8"> | 3188 | <form enctype="application/x-www-form-urlencoded" role="form" action="/api/bind/getScore" method="POST" name="form8" id="form8"> |
3245 | <div class="form-group"> | 3189 | <div class="form-group"> |
3246 | - <label class="control-label" for="xq">xq</label> | ||
3247 | - <input type="string" class="form-control input-sm" id="xq" required placeholder="校区id" name="xq"> | 3190 | + <label class="control-label" for="campus_id">campus_id</label> |
3191 | + <input type="string" class="form-control input-sm" id="campus_id" required placeholder="校区id" name="campus_id"> | ||
3248 | </div> | 3192 | </div> |
3249 | <div class="form-group form-group-submit"> | 3193 | <div class="form-group form-group-submit"> |
3250 | <button type="submit" class="btn btn-success send" rel="8">提交</button> | 3194 | <button type="submit" class="btn btn-success send" rel="8">提交</button> |
@@ -4563,7 +4507,7 @@ | @@ -4563,7 +4507,7 @@ | ||
4563 | 4507 | ||
4564 | </div> | 4508 | </div> |
4565 | <div class="col-md-6" align="right"> | 4509 | <div class="col-md-6" align="right"> |
4566 | - Generated on 2023-03-09 15:44:57 <a href="./" target="_blank">校园活动</a> | 4510 | + Generated on 2023-03-09 16:50:56 <a href="./" target="_blank">校园活动</a> |
4567 | </div> | 4511 | </div> |
4568 | </div> | 4512 | </div> |
4569 | 4513 |
-
请 注册 或 登录 后发表评论