正在显示
6 个修改的文件
包含
162 行增加
和
31 行删除
@@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
2 | 2 | ||
3 | namespace app\admin\controller; | 3 | namespace app\admin\controller; |
4 | 4 | ||
5 | +use app\admin\model\item\ronda\Rel; | ||
5 | use app\common\controller\Backend; | 6 | use app\common\controller\Backend; |
7 | +use mysql_xdevapi\DocResult; | ||
6 | 8 | ||
7 | /** | 9 | /** |
8 | * 数据大屏管理 | 10 | * 数据大屏管理 |
@@ -69,4 +71,72 @@ class Screen extends Backend | @@ -69,4 +71,72 @@ class Screen extends Backend | ||
69 | return $this->view->fetch(); | 71 | return $this->view->fetch(); |
70 | } | 72 | } |
71 | 73 | ||
74 | + public function details($ids) | ||
75 | + { | ||
76 | + $row = $this->model->get(['id'=>$ids]); | ||
77 | + if (!$row) { | ||
78 | + $this->error(__('No Results were found')); | ||
79 | + } | ||
80 | + if ($this->request->isAjax()) { | ||
81 | + $this->success("Ajax请求成功", null, ['id' => $ids]); | ||
82 | + } | ||
83 | + $data = $row->toArray(); | ||
84 | + $res = db('study_score_log l') | ||
85 | + ->join('team t','l.team_id = t.id') | ||
86 | + ->where('campus_id',$data['campus_id']) | ||
87 | + ->field('l.team_id,sum(l.score) as sum_score,t.title') | ||
88 | + ->group('l.team_id') | ||
89 | + ->order('sum_score','desc') | ||
90 | + ->select(); | ||
91 | + $list = []; | ||
92 | +// foreach ($res as $k1){ | ||
93 | +// foreach ($k1 as $k2 => $v){ | ||
94 | +//// dump($k2); | ||
95 | +//// dump($v); | ||
96 | +// $list['title'] = $v; | ||
97 | +// $list['score'] = $v; | ||
98 | +// } | ||
99 | +// } | ||
100 | + foreach ($res as $k => $v){ | ||
101 | + $list['title'] = $v['title']; | ||
102 | + $list['score'] = $v['sum_score']; | ||
103 | + } | ||
104 | + //dump($list); | ||
105 | + $this->view->assign("row", $list); | ||
106 | + return $this->view->fetch(); | ||
107 | + } | ||
108 | + public function detail($ids) | ||
109 | + { | ||
110 | + $row = $this->model->get(['id'=>$ids]); | ||
111 | + if (!$row) { | ||
112 | + $this->error(__('No Results were found')); | ||
113 | + } | ||
114 | + if ($this->request->isAjax()) { | ||
115 | + $this->success("Ajax请求成功", null, ['id' => $ids]); | ||
116 | + } | ||
117 | + $data = $row->toArray(); | ||
118 | + $res = db('study_score_log l') | ||
119 | + ->join('study s','l.study_id = s.id') | ||
120 | + ->where('campus_id',$data['campus_id']) | ||
121 | + ->field('l.team_id,sum(l.score) as sum_score,s.name') | ||
122 | + ->group('l.study_id') | ||
123 | + ->order('sum_score','desc') | ||
124 | + ->select(); | ||
125 | + $list = []; | ||
126 | +// foreach ($res as $k1){ | ||
127 | +// foreach ($k1 as $k2 => $v){ | ||
128 | +//// dump($k2); | ||
129 | +//// dump($v); | ||
130 | +// $list['title'] = $v; | ||
131 | +// $list['score'] = $v; | ||
132 | +// } | ||
133 | +// } | ||
134 | + foreach ($res as $k => $v){ | ||
135 | + $list['name'] = $v['name']; | ||
136 | + $list['score'] = $v['sum_score']; | ||
137 | + } | ||
138 | + //dump($list); | ||
139 | + $this->view->assign("row", $list); | ||
140 | + return $this->view->fetch(); | ||
141 | + } | ||
72 | } | 142 | } |
@@ -29,7 +29,6 @@ class Screen extends Model | @@ -29,7 +29,6 @@ class Screen extends Model | ||
29 | 'endtime_text', | 29 | 'endtime_text', |
30 | 'is_view_text', | 30 | 'is_view_text', |
31 | 'count_time', | 31 | 'count_time', |
32 | - 'team_info' | ||
33 | ]; | 32 | ]; |
34 | 33 | ||
35 | 34 | ||
@@ -87,14 +86,14 @@ class Screen extends Model | @@ -87,14 +86,14 @@ class Screen extends Model | ||
87 | } | 86 | } |
88 | 87 | ||
89 | //战队信息 | 88 | //战队信息 |
90 | - public function getTeamInfoAttr($value,$data){ | ||
91 | - $list = []; | ||
92 | - $value = db('study_score_log')->where('campus_id',$data['campus_id'])->field('team_id')->select(); | ||
93 | - foreach ($value as $k => $v){ | ||
94 | - $list = db('team')->where('id',$value[$k]['team_id'])->field('title,score')->find(); | ||
95 | - } | ||
96 | - return $list; | ||
97 | - } | 89 | +// public function getTeamInfoAttr($value,$data){ |
90 | +// $list = []; | ||
91 | +// $value = db('study_score_log')->where('campus_id',$data['campus_id'])->field('team_id')->select(); | ||
92 | +// foreach ($value as $k => $v){ | ||
93 | +// $list = db('team')->where('id',$value[$k]['team_id'])->field('title,score')->find(); | ||
94 | +// } | ||
95 | +// return $list; | ||
96 | +// } | ||
98 | 97 | ||
99 | 98 | ||
100 | public function campus() | 99 | public function campus() |
application/admin/view/screen/detail.html
0 → 100644
1 | +<table class="table table-striped"> | ||
2 | + <thead> | ||
3 | + <tr> | ||
4 | + <th>{:__('个人名称')}</th> | ||
5 | + <th>{:__('个人票数')}</th> | ||
6 | + </tr> | ||
7 | + </thead> | ||
8 | + <tbody> | ||
9 | + {/*{volist name="row" id="vo"&cc; | ||
10 | + <tr> | ||
11 | + <td>{$key&cc;</td> | ||
12 | + <td style="word-break: break-all;">{$vo|htmlentities&cc;</td> | ||
13 | + </tr> | ||
14 | + {/volist&cc;*/} | ||
15 | + <tr> | ||
16 | + <td>{$row.name}</td> | ||
17 | + <td style="word-break: break-all;">{$row.score}</td> | ||
18 | + </tr> | ||
19 | + </tbody> | ||
20 | +</table> | ||
21 | +<div class="hide layer-footer"> | ||
22 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
23 | + <div class="col-xs-12 col-sm-8"> | ||
24 | + <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button> | ||
25 | + </div> | ||
26 | +</div> |
application/admin/view/screen/details.html
0 → 100644
1 | +<table class="table table-striped"> | ||
2 | + <thead> | ||
3 | + <tr> | ||
4 | + <th>{:__('战队名称')}</th> | ||
5 | + <th>{:__('战队票数')}</th> | ||
6 | + </tr> | ||
7 | + </thead> | ||
8 | + <tbody> | ||
9 | + {/*{volist name="row" id="vo"&cc; | ||
10 | + <tr> | ||
11 | + <td>{$key&cc;</td> | ||
12 | + <td style="word-break: break-all;">{$vo|htmlentities&cc;</td> | ||
13 | + </tr> | ||
14 | + {/volist&cc;*/} | ||
15 | + <tr> | ||
16 | + <td>{$row.title}</td> | ||
17 | + <td style="word-break: break-all;">{$row.score}</td> | ||
18 | + </tr> | ||
19 | + </tbody> | ||
20 | +</table> | ||
21 | +<div class="hide layer-footer"> | ||
22 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
23 | + <div class="col-xs-12 col-sm-8"> | ||
24 | + <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button> | ||
25 | + </div> | ||
26 | +</div> |
@@ -57,27 +57,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -57,27 +57,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
57 | {field: 'user.teach_phone', title: __('User.teach_phone'), operate: false}, | 57 | {field: 'user.teach_phone', title: __('User.teach_phone'), operate: false}, |
58 | {field: 'radar.title', title: __('Radar.title'), operate: false}, | 58 | {field: 'radar.title', title: __('Radar.title'), operate: false}, |
59 | {field: 'createtime', title: __('Createtime'), operate:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | 59 | {field: 'createtime', title: __('Createtime'), operate:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, |
60 | - { | ||
61 | - field: 'buttons', | ||
62 | - width: "120px", | ||
63 | - title: __('按钮组'), | ||
64 | - table: table, | ||
65 | - events: Table.api.events.operate, | ||
66 | - buttons: [ | ||
67 | - { | ||
68 | - name: 'detail', | ||
69 | - text: __('弹出窗口打开'), | ||
70 | - title: __('弹出窗口打开'), | ||
71 | - classname: 'btn btn-xs btn-primary btn-dialog', | ||
72 | - icon: 'fa fa-list', | ||
73 | - url: 'study_score_log/add', | ||
74 | - callback: function (data) { | ||
75 | - Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"}); | ||
76 | - }, | ||
77 | - } | ||
78 | - ], | ||
79 | - formatter: Table.api.formatter.buttons | ||
80 | - }, | ||
81 | //{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | 60 | //{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, |
82 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | 61 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} |
83 | ] | 62 | ] |
@@ -37,10 +37,41 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | @@ -37,10 +37,41 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin | ||
37 | //{field: 'campus_id', title: __('Campus_id')}, | 37 | //{field: 'campus_id', title: __('Campus_id')}, |
38 | {field: 'campus.title', title: __('Campus.title'), operate: 'LIKE'}, | 38 | {field: 'campus.title', title: __('Campus.title'), operate: 'LIKE'}, |
39 | {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, | 39 | {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images}, |
40 | - {field: 'team_info', title: __('战队排行榜')}, | ||
41 | //{field: 'starttime', title: __('Starttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | 40 | //{field: 'starttime', title: __('Starttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, |
42 | //{field: 'endtime', title: __('Endtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, | 41 | //{field: 'endtime', title: __('Endtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, |
43 | {field: 'is_view', title: __('Is_view'), searchList: {"0":__('Is_view 0'),"1":__('Is_view 1')},formatter:Table.api.formatter.toggle}, | 42 | {field: 'is_view', title: __('Is_view'), searchList: {"0":__('Is_view 0'),"1":__('Is_view 1')},formatter:Table.api.formatter.toggle}, |
43 | + { | ||
44 | + field: 'buttons', | ||
45 | + width: "120px", | ||
46 | + title: __('按钮组'), | ||
47 | + table: table, | ||
48 | + events: Table.api.events.operate, | ||
49 | + buttons: [ | ||
50 | + { | ||
51 | + name: 'details', | ||
52 | + text: __('战队排行榜'), | ||
53 | + title: __('战队排行榜'), | ||
54 | + classname: 'btn btn-xs btn-primary btn-dialog', | ||
55 | + icon: 'fa fa-list', | ||
56 | + url: 'screen/details', | ||
57 | + callback: function (data) { | ||
58 | + Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"}); | ||
59 | + }, | ||
60 | + }, | ||
61 | + { | ||
62 | + name: 'detail', | ||
63 | + text: __('个人排行榜'), | ||
64 | + title: __('个人排行榜'), | ||
65 | + classname: 'btn btn-xs btn-primary btn-dialog', | ||
66 | + icon: 'fa fa-list', | ||
67 | + url: 'screen/detail', | ||
68 | + callback: function (data) { | ||
69 | + Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"}); | ||
70 | + }, | ||
71 | + } | ||
72 | + ], | ||
73 | + formatter: Table.api.formatter.buttons | ||
74 | + }, | ||
44 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} | 75 | {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} |
45 | ] | 76 | ] |
46 | ] | 77 | ] |
-
请 注册 或 登录 后发表评论