feat: add comprehensive dashboard showing all analysis metrics in one view
This commit is contained in:
@@ -22,7 +22,7 @@ class History extends Backend
|
||||
* 无需额外权限检查的方法(但仍在 admin 模块内,需要 admin 登录)
|
||||
* @var array
|
||||
*/
|
||||
protected $noNeedRight = ['missingNum', 'trendData', 'hotColdNumbers', 'colorWaveAnalysis', 'zodiacAnalysis', 'oddEvenAnalysis', 'bigSmallAnalysis', 'sumAnalysis', 'consecutiveNumbers', 'tailNumbers'];
|
||||
protected $noNeedRight = ['missingNum', 'trendData', 'hotColdNumbers', 'colorWaveAnalysis', 'zodiacAnalysis', 'oddEvenAnalysis', 'bigSmallAnalysis', 'sumAnalysis', 'consecutiveNumbers', 'tailNumbers', 'dashboard'];
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
@@ -217,5 +217,24 @@ class History extends Backend
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 综合统计面板
|
||||
*/
|
||||
public function dashboard()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$periods = $this->request->get('periods', 30, 'intval');
|
||||
if ($periods < 10 || $periods > 100) {
|
||||
$this->error('期数范围必须在 10-100 之间');
|
||||
}
|
||||
$type = $this->request->get('type', 'all');
|
||||
if (!in_array($type, ['all', 'special'])) {
|
||||
$this->error('查询类型不正确');
|
||||
}
|
||||
$result = $this->model->getDashboardData($periods, $type);
|
||||
$this->success('查询成功', null, $result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -25,4 +25,5 @@ return [
|
||||
'Sum Chart' => '和值分析',
|
||||
'Consecutive' => '连号分析',
|
||||
'Tail Numbers' => '尾数分析',
|
||||
'Dashboard' => '综合统计面板',
|
||||
];
|
||||
|
||||
@@ -446,5 +446,21 @@ class History extends Model
|
||||
return ['all' => $all];
|
||||
}
|
||||
|
||||
/**
|
||||
* 综合统计面板
|
||||
*/
|
||||
public function getDashboardData($periods = 30, $type = 'all')
|
||||
{
|
||||
return [
|
||||
'hotcold' => $this->getHotColdNumbers($periods, $type),
|
||||
'colorwave' => $this->getColorWaveAnalysis($periods, $type),
|
||||
'zodiac' => $this->getZodiacAnalysis($periods, $type),
|
||||
'oddeven' => $this->getOddEvenAnalysis($periods, $type),
|
||||
'bigsmall' => $this->getBigSmallAnalysis($periods, $type),
|
||||
'sum' => $this->getSumAnalysis($periods),
|
||||
'tailnumbers' => $this->getTailNumbers($periods, $type)
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<a href="javascript:;" class="btn btn-primary btn-sumchart" title="{:__('Sum Chart')}"><i class="fa fa-line-chart"></i> {:__('Sum Chart')}</a>
|
||||
<a href="javascript:;" class="btn btn-dark btn-consecutive" title="{:__('Consecutive')}"><i class="fa fa-link"></i> {:__('Consecutive')}</a>
|
||||
<a href="javascript:;" class="btn btn-default btn-tailnums" title="{:__('Tail Numbers')}"><i class="fa fa-list-ol"></i> {:__('Tail Numbers')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-dashboard" title="{:__('Dashboard')}"><i class="fa fa-tachometer"></i> {:__('Dashboard')}</a>
|
||||
<!-- <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('history/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
|
||||
Reference in New Issue
Block a user