feat(history): 添加历史数据管理功能和数据分析图表
- 在addons.php中添加example模块路由配置 - 新增application/config.php配置文件,包含应用设置、数据库配置等 - 实现dashboard.js仪表盘功能,包含冷热号码分析、比例分析图表 - 添加history.js历史数据管理功能,支持号码查询和统计分析 - 集成echarts图表库实现数据可视化展示 - 添加号码颜色映射和生肖映射功能 - 实现号码球样式格式化显示 - 添加遗漏号码、走势图、冷热分析等数据分析功能
This commit is contained in:
@@ -31,6 +31,49 @@ class History extends Backend
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看开奖记录(支持按每月日号筛选)
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if (false === $this->request->isAjax()) {
|
||||
return $this->view->fetch();
|
||||
}
|
||||
if ($this->request->request('keyField')) {
|
||||
return $this->selectpage();
|
||||
}
|
||||
// search_day 在 filter JSON 里,先提取出来再移除
|
||||
$filterStr = $this->request->get('filter', '[]', 'trim');
|
||||
$opStr = $this->request->get('op', '[]', 'trim');
|
||||
$filter = json_decode($filterStr, true) ?: [];
|
||||
$op = json_decode($opStr, true) ?: [];
|
||||
$searchDay = isset($filter['search_day']) ? $filter['search_day'] : '';
|
||||
unset($filter['search_day'], $op['search_day']);
|
||||
// 写回 Request 对象
|
||||
$ref = new \ReflectionProperty($this->request, 'get');
|
||||
$ref->setAccessible(true);
|
||||
$getData = $ref->getValue($this->request);
|
||||
if (is_array($getData)) {
|
||||
$getData['filter'] = json_encode($filter);
|
||||
$getData['op'] = json_encode($op);
|
||||
$ref->setValue($this->request, $getData);
|
||||
}
|
||||
|
||||
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
|
||||
$list = $this->model->where($where);
|
||||
// 按每月日号筛选
|
||||
if ($searchDay !== '' && is_numeric($searchDay)) {
|
||||
$day = intval($searchDay);
|
||||
if ($day >= 1 && $day <= 31) {
|
||||
$list = $list->whereRaw('DAY(openTime) = ?', [$day]);
|
||||
}
|
||||
}
|
||||
$query = $list->order($sort, $order)->paginate($limit);
|
||||
$result = ['total' => $query->total(), 'rows' => $query->items()];
|
||||
return json($result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询遗漏号码
|
||||
|
||||
Reference in New Issue
Block a user