123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\admin\controller;
- use app\common\controller\Backend;
- use think\Db;
- /**
- * 控制台
- *
- * @icon fa fa-dashboard
- * @remark 用于展示当前系统中的统计数据、统计报表及重要实时数据
- */
- class Dashboard extends Backend
- {
- /**
- * 查看
- */
- public function index()
- {
- //商户数
- $user_count = Db::name('user')->count();
- //师傅数
- $worker_count = Db::name('worker')->where('deletetime',NULL)->count();
- //公司数
- $company_count = Db::name('company')->where('deletetime',NULL)->count();
- //维保订单数
- $maintain_count = Db::name('maintain')->count();
- //检测下发数
- $jiance_count = Db::name('jiance')->count();
- $this->view->assign([
- 'user_count' => $user_count,
- 'worker_count' => $worker_count,
- 'company_count' => $company_count,
- 'maintain_count' => $maintain_count,
- 'jiance_count' => $jiance_count,
- ]);
- return $this->view->fetch();
- }
- }
|