Stat.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\stat;
  12. use app\service\admin\article\ArticleService;
  13. use app\service\admin\stat\StatService;
  14. use core\base\BaseAdminController;
  15. use think\Response;
  16. /**
  17. * 统计数据
  18. * Class Stat
  19. * @package app\adminapi\controller\stat
  20. */
  21. class Stat extends BaseAdminController
  22. {
  23. /**
  24. * 首页数据
  25. * @return Response
  26. */
  27. public function index()
  28. {
  29. $data = (new StatService())->getIndexStatData();
  30. return success($data);
  31. }
  32. /**
  33. * 首页图表数据
  34. * @return Response
  35. */
  36. public function chart()
  37. {
  38. $data = (new StatService())->getIndexChartStat();
  39. return success($data);
  40. }
  41. /**
  42. * 首页文章数据
  43. * @return Response
  44. */
  45. public function news()
  46. {
  47. $data = (new ArticleService())->getAll(10);
  48. return success($data);
  49. }
  50. }