Commit 71cbccbbb426d63084f8cf3da5ae87e68d5557b3
1 parent
ed2d4ab4
节目名单投票排名
Showing
3 changed files
with
53 additions
and
1 deletions
lottery.js
... | ... | @@ -317,6 +317,13 @@ let setting = { |
317 | 317 | dataListBind('user-bind', 'user', data); |
318 | 318 | }); |
319 | 319 | }, |
320 | + // 奖项排名 | |
321 | + itemVoteList: function(){ | |
322 | + let url = "/apicp.ItemVoteList.php"; | |
323 | + baseRquest.get(url, {}, data => { | |
324 | + dataListBind('item_vote', 'item_vote_list', data); | |
325 | + }); | |
326 | + }, | |
320 | 327 | // 删除用户 |
321 | 328 | delUser: function(row){ |
322 | 329 | console.log(this.userData); | ... | ... |
phpapi/apicp.ItemVoteList.php
0 → 100644
1 | +<?php | |
2 | + /** | |
3 | + * 获取用户列表 | |
4 | + * 中奖用户列表会多给中奖类型和中奖时间 | |
5 | + */ | |
6 | + include "Common/JsonResponse.php"; | |
7 | + include "Common/mysqlHelper.php"; | |
8 | + include "Common/Encrypter.php"; | |
9 | + header('Access-Control-Allow-Origin:*'); | |
10 | + header("Access-Control-Allow-Methods:GET,POST"); | |
11 | + header("Access-Control-Allow-Headers:Content-Type,token,X-Requested-With"); | |
12 | + if(strtoupper($_SERVER['REQUEST_METHOD'])== 'OPTIONS'){ | |
13 | + exit; | |
14 | + } | |
15 | + | |
16 | + | |
17 | + $sql = "select | |
18 | + * , | |
19 | + (select count(1) from item_vote iv where iv.item_id = i.id) as vote_no | |
20 | + from item i | |
21 | + ORDER BY vote_no desc"; | |
22 | + | |
23 | + | |
24 | + $mysql = new mysqlHelper(); | |
25 | + $data = $mysql->fetchAll($sql); | |
26 | + JsonResponse::result($data); | |
0 | 27 | \ No newline at end of file | ... | ... |
setting.html
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | img{width:100px;height: auto;float: left;} |
13 | 13 | li{height: 50px;line-height: 50px;padding: 10px;} |
14 | 14 | .user-item{width:150px;height: 200px;float: left;border: 1px solid #fff;overflow: hidden;} |
15 | + th,td{border: 1px solid #ffffff;font-size: 30px} | |
15 | 16 | </style> |
16 | 17 | <script src="axios.js"></script> |
17 | 18 | <script src="jquery.min.js"></script> |
... | ... | @@ -45,7 +46,7 @@ |
45 | 46 | <span onclick="setting.userList()">用户管理</span> |
46 | 47 | </li> |
47 | 48 | </ul> |
48 | - <div> | |
49 | + <div style="overflow: hidden"> | |
49 | 50 | <div class="user-list" z-for-container = "user-bind"> |
50 | 51 | <div z-for-item = "user" class="user-item"> |
51 | 52 | <img z-for-data = "headimg"> |
... | ... | @@ -57,6 +58,24 @@ |
57 | 58 | </div> |
58 | 59 | </div> |
59 | 60 | </div> |
61 | + | |
62 | + <div> | |
63 | + <table style="margin-top: 50px;"> | |
64 | + <tr> | |
65 | + <th>名次</th> | |
66 | + <th>节目名称</th> | |
67 | + <th>投票数量</th> | |
68 | + </tr> | |
69 | + </table> | |
70 | + <table z-for-container = "item_vote"> | |
71 | + <tr z-for-item = "item_vote_list"> | |
72 | + <td z-for-data = "id"></td> | |
73 | + <td z-for-data = "item_name"></td> | |
74 | + <td z-for-data = "vote_no"></td> | |
75 | + </tr> | |
76 | + </table> | |
77 | + | |
78 | + </div> | |
60 | 79 | </body> |
61 | 80 | <script> |
62 | 81 | </script> | ... | ... |