mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-22 03:32:47 +08:00
* 更新版本号 * 完善后台今日统计,增加权限白名单,增加后台首页菜单,调整后台登录页样式 * Merge branch 'koogua/I1XFCF' of https://gitee.com/koogua/course-tencen… * 前台学习资料部分完成 * !2 后台运营统计合并 * 后台学习资料部分完成 * Merge branch 'master' into develop * Merge branch 'master' of https://github.com/xiaochong0302/course-tencent-cloud * 1.增加changelog.md * 1.简化部分路由地址 * Merge pull request #2 from xiaochong0302/dependabot/composer/symfony/h… * Bump symfony/http-foundation from 4.3.4 to 5.1.6
99 lines
2.6 KiB
PHP
99 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Admin\Controllers;
|
|
|
|
use App\Http\Admin\Services\Stat as StatService;
|
|
|
|
/**
|
|
* @RoutePrefix("/admin/stat")
|
|
*/
|
|
class StatController extends Controller
|
|
{
|
|
|
|
/**
|
|
* @Get("/sales/hot", name="admin.stat.hot_sales")
|
|
*/
|
|
public function hotSalesAction()
|
|
{
|
|
$statService = new StatService();
|
|
|
|
$years = $statService->getYearOptions();
|
|
$months = $statService->getMonthOptions();
|
|
$items = $statService->hotSales();
|
|
|
|
$this->view->pick('stat/hot_sales');
|
|
$this->view->setVar('years', $years);
|
|
$this->view->setVar('months', $months);
|
|
$this->view->setVar('items', $items);
|
|
}
|
|
|
|
/**
|
|
* @Get("/sales", name="admin.stat.sales")
|
|
*/
|
|
public function salesAction()
|
|
{
|
|
$statService = new StatService();
|
|
|
|
$years = $statService->getYearOptions();
|
|
$months = $statService->getMonthOptions();
|
|
$data = $statService->sales();
|
|
|
|
$this->view->pick('stat/sales');
|
|
$this->view->setVar('years', $years);
|
|
$this->view->setVar('months', $months);
|
|
$this->view->setVar('data', $data);
|
|
}
|
|
|
|
/**
|
|
* @Get("/refunds", name="admin.stat.refunds")
|
|
*/
|
|
public function refundsAction()
|
|
{
|
|
$statService = new StatService();
|
|
|
|
$years = $statService->getYearOptions();
|
|
$months = $statService->getMonthOptions();
|
|
$data = $statService->refunds();
|
|
|
|
$this->view->pick('stat/refunds');
|
|
$this->view->setVar('years', $years);
|
|
$this->view->setVar('months', $months);
|
|
$this->view->setVar('data', $data);
|
|
}
|
|
|
|
/**
|
|
* @Get("/users/registered", name="admin.stat.reg_users")
|
|
*/
|
|
public function registeredUsersAction()
|
|
{
|
|
$statService = new StatService();
|
|
|
|
$years = $statService->getYearOptions();
|
|
$months = $statService->getMonthOptions();
|
|
$data = $statService->registeredUsers();
|
|
|
|
$this->view->pick('stat/registered_users');
|
|
$this->view->setVar('years', $years);
|
|
$this->view->setVar('months', $months);
|
|
$this->view->setVar('data', $data);
|
|
}
|
|
|
|
/**
|
|
* @Get("/users/online", name="admin.stat.online_users")
|
|
*/
|
|
public function onlineUsersAction()
|
|
{
|
|
$statService = new StatService();
|
|
|
|
$years = $statService->getYearOptions();
|
|
$months = $statService->getMonthOptions();
|
|
$data = $statService->onlineUsers();
|
|
|
|
$this->view->pick('stat/online_users');
|
|
$this->view->setVar('years', $years);
|
|
$this->view->setVar('months', $months);
|
|
$this->view->setVar('data', $data);
|
|
}
|
|
|
|
}
|