AdminDataController.php 1.6 KB
<?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();
    }



}