最新版本

This commit is contained in:
2026-05-26 09:44:21 +08:00
parent 822ed9a099
commit fa41edf857
24 changed files with 597 additions and 163 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace app\admin\controller;
use app\BaseController;
use app\admin\service\UtillService;
use think\facade\Session;
class Utill extends BaseController
{
/* 获取需要导出的数据
$range范围week,month
*/
public function getExportData(UtillService $UtillService)
{
$range = $this->request->post('range');
try {
# session中获取当前登录是否是管理员
$isAdmin = Session::get('user_info.role') === 'admin' ? true : false; // 后续用来判断
if (!$isAdmin) {
return json(['code' => 403, 'msg' => '权限不足', 'data' => []]);
}
$data = $UtillService->getExportData($range);
return json(['code' => 200, 'msg' => '查询成功', 'data' => $data]);
} catch (\Exception $e) {
return json(['code' => 500, 'msg' => '查询失败', 'data' => []]);
}
}
}