作者 郭盛
1 个管道 的构建 通过 耗费 0 秒

统计

<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/9/7
* Time: 15:03
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
class StatisticController extends AdminBaseController
{
//实时数据
public function index()
{
$data['provide'] = Db::name('job')
->where('job_type',1)
->where('delete_time',0)
->whereTime('create_time','today')
->where('status',1)
->count();
$data['demand'] = Db::name('job')
->where('job_type',2)
->where('delete_time',0)
->whereTime('create_time','today')
->where('status',1)
->count();
$data['active'] = Db::name('job')
->where('job_type',3)
->where('delete_time',0)
->whereTime('create_time','today')
->where('status',1)
->count();
$data['attract'] = Db::name('job')
->where('job_type',4)
->where('delete_time',0)
->whereTime('create_time','today')
->where('status',1)
->count();
$data['man'] = Db::name('user')
->whereTime('create_time','today')
->count();
$this->assign('data',$data);
return $this->fetch();
}
}
\ No newline at end of file
... ...
<include file="public@header" />
</head>
<style>
th,td{
text-align: center;
}
</style>
<body>
<div class="wrap js-check-wrap">
<ul class="nav nav-tabs">
<li class="active"><a href="{:url('Statistic/index')}">实时数据</a></li>
</ul>
<form class="js-ajax-form" action="" method="post">
<table class="table table-hover table-bordered">
<thead>
<tr>
<th>新增供给</th>
<th>新增需求</th>
<th>新增活动</th>
<th>招商加盟</th>
<th>新增用户</th>
</tr>
</thead>
<tbody>
<tr style="font-size: 20px">
<td>{$data.provide}个供给</td>
<td>{$data.demand}个需求</td>
<td>{$data.active}个活动</td>
<td>{$data.attract}个合作</td>
<td>{$data.man}个</td>
</tr>
</tbody>
</table>
</form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
\ No newline at end of file
... ...