12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- // +----------------------------------------------------------------------
- // | Niucloud-admin 企业快速开发的saas管理平台
- // +----------------------------------------------------------------------
- // | 官方网址:https://www.niucloud.com
- // +----------------------------------------------------------------------
- // | niucloud团队 版权所有 开源版本可自由商用
- // +----------------------------------------------------------------------
- // | Author: Niucloud Team
- // +----------------------------------------------------------------------
- namespace app\adminapi\controller\stat;
- use app\service\admin\article\ArticleService;
- use app\service\admin\stat\StatService;
- use core\base\BaseAdminController;
- use think\Response;
- /**
- * 统计数据
- * Class Stat
- * @package app\adminapi\controller\stat
- */
- class Stat extends BaseAdminController
- {
- /**
- * 首页数据
- * @return Response
- */
- public function index()
- {
- $data = (new StatService())->getIndexStatData();
- return success($data);
- }
- /**
- * 首页图表数据
- * @return Response
- */
- public function chart()
- {
- $data = (new StatService())->getIndexChartStat();
- return success($data);
- }
- /**
- * 首页文章数据
- * @return Response
- */
- public function news()
- {
- $data = (new ArticleService())->getAll(10);
- return success($data);
- }
- }
|