Dashboard.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\model\Admin;
  4. use app\admin\model\User;
  5. use app\common\controller\Backend;
  6. use app\common\model\Attachment;
  7. use fast\Date;
  8. use think\Db;
  9. /**
  10. * 控制台
  11. *
  12. * @icon fa fa-dashboard
  13. * @remark 用于展示当前系统中的统计数据、统计报表及重要实时数据
  14. */
  15. class Dashboard extends Backend
  16. {
  17. /**
  18. * 查看
  19. */
  20. public function index()
  21. {
  22. //套餐延期申请
  23. $package_delay = Db::name('package_delay')->where('status',0)->count();
  24. //套餐转让申请
  25. $package_move = Db::name('package_move')->where('status',0)->count();
  26. //预约退课申请
  27. $order_refund = Db::name('order_refund')->where('status',0)->count();
  28. //公司团建预约
  29. $company_apply = Db::name('company_apply')->where('status',0)->count();
  30. //用户申请激活配套待审核
  31. $where = [
  32. 'order_status' => 1, //已支付
  33. 'is_gift' => 0, //不是赠品
  34. 'use_status' => 0, //未激活
  35. 'use_apply_status' => 1, //已申请激活
  36. ];
  37. $packageorder_audit = Db::name('package_order')->where($where)->count();
  38. $this->view->assign([
  39. 'package_delay' => $package_delay,
  40. 'package_move' => $package_move,
  41. 'order_refund' => $order_refund,
  42. 'company_apply' => $company_apply,
  43. 'packageorder_audit' => $packageorder_audit,
  44. ]);
  45. return $this->view->fetch();
  46. }
  47. }