...
|
...
|
@@ -2,7 +2,9 @@ |
|
|
|
|
|
namespace app\admin\controller;
|
|
|
|
|
|
use app\admin\model\item\ronda\Rel;
|
|
|
use app\common\controller\Backend;
|
|
|
use mysql_xdevapi\DocResult;
|
|
|
|
|
|
/**
|
|
|
* 数据大屏管理
|
...
|
...
|
@@ -69,4 +71,72 @@ class Screen extends Backend |
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|
|
|
public function details($ids)
|
|
|
{
|
|
|
$row = $this->model->get(['id'=>$ids]);
|
|
|
if (!$row) {
|
|
|
$this->error(__('No Results were found'));
|
|
|
}
|
|
|
if ($this->request->isAjax()) {
|
|
|
$this->success("Ajax请求成功", null, ['id' => $ids]);
|
|
|
}
|
|
|
$data = $row->toArray();
|
|
|
$res = db('study_score_log l')
|
|
|
->join('team t','l.team_id = t.id')
|
|
|
->where('campus_id',$data['campus_id'])
|
|
|
->field('l.team_id,sum(l.score) as sum_score,t.title')
|
|
|
->group('l.team_id')
|
|
|
->order('sum_score','desc')
|
|
|
->select();
|
|
|
$list = [];
|
|
|
// foreach ($res as $k1){
|
|
|
// foreach ($k1 as $k2 => $v){
|
|
|
//// dump($k2);
|
|
|
//// dump($v);
|
|
|
// $list['title'] = $v;
|
|
|
// $list['score'] = $v;
|
|
|
// }
|
|
|
// }
|
|
|
foreach ($res as $k => $v){
|
|
|
$list['title'] = $v['title'];
|
|
|
$list['score'] = $v['sum_score'];
|
|
|
}
|
|
|
//dump($list);
|
|
|
$this->view->assign("row", $list);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
public function detail($ids)
|
|
|
{
|
|
|
$row = $this->model->get(['id'=>$ids]);
|
|
|
if (!$row) {
|
|
|
$this->error(__('No Results were found'));
|
|
|
}
|
|
|
if ($this->request->isAjax()) {
|
|
|
$this->success("Ajax请求成功", null, ['id' => $ids]);
|
|
|
}
|
|
|
$data = $row->toArray();
|
|
|
$res = db('study_score_log l')
|
|
|
->join('study s','l.study_id = s.id')
|
|
|
->where('campus_id',$data['campus_id'])
|
|
|
->field('l.team_id,sum(l.score) as sum_score,s.name')
|
|
|
->group('l.study_id')
|
|
|
->order('sum_score','desc')
|
|
|
->select();
|
|
|
$list = [];
|
|
|
// foreach ($res as $k1){
|
|
|
// foreach ($k1 as $k2 => $v){
|
|
|
//// dump($k2);
|
|
|
//// dump($v);
|
|
|
// $list['title'] = $v;
|
|
|
// $list['score'] = $v;
|
|
|
// }
|
|
|
// }
|
|
|
foreach ($res as $k => $v){
|
|
|
$list['name'] = $v['name'];
|
|
|
$list['score'] = $v['sum_score'];
|
|
|
}
|
|
|
//dump($list);
|
|
|
$this->view->assign("row", $list);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
} |
...
|
...
|
|