AdminDataController.php
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/**
* 数据统计
* Author : xiaojie
* DateTime: 2018/12/04 13:11
*/
namespace app\portal\controller;
use app\portal\model\StatisticsModel;
use cmf\controller\AdminBaseController;
/**
* Class AdminDataController
* @package app\portal\controller
* @adminMenuRoot(
* 'name' =>'数据统计',
* 'action' =>'default',
* 'parent' =>'',
* 'display'=> true,
* 'order' => 30,
* 'icon' =>'th',
* 'remark' =>'数据统计'
* )
*/
class AdminDataController extends AdminBaseController
{
/**
* 数据统计
* @adminMenu(
* 'name' => '数据统计',
* 'parent' => 'portal/AdminData/default',
* 'display'=> true,
* 'hasView'=> true,
* 'order' => 10000,
* 'icon' => '',
* 'remark' => '数据统计',
* 'param' => ''
* )
*/
public function index()
{
$param = $this->request->param();
$statisticsModel = new StatisticsModel();
$map = $this->search2($param);
$total_num = $statisticsModel->getTotalNum();
$today_num = $statisticsModel->getTodayNum();
$data = $statisticsModel->getBrokenData($map);
$list3 = $statisticsModel->getCakeData($map);
$list1 = empty($data)?'':json_encode($data['list1']);
$list2 = empty($data)?'':json_encode($data['list2']);
$list3 = empty($list3)?'':json_encode($list3);
$this->assign('total_num',$total_num);
$this->assign('today_num',$today_num);
$this->assign('list1',$list1);
$this->assign('list2',$list2);
$this->assign('list3',$list3);
return $this->fetch();
}
}