feat(phase-3): add hot/cold number analysis with period filter

This commit is contained in:
2026-04-21 23:41:39 +08:00
parent 7e4b6a3443
commit f36410dcc6
5 changed files with 197 additions and 1 deletions
+21 -1
View File
@@ -22,7 +22,7 @@ class History extends Backend
* 无需额外权限检查的方法(但仍在 admin 模块内,需要 admin 登录)
* @var array
*/
protected $noNeedRight = ['missingNum', 'trendData'];
protected $noNeedRight = ['missingNum', 'trendData', 'hotColdNumbers'];
public function _initialize()
{
@@ -72,5 +72,25 @@ class History extends Backend
}
}
/**
* 获取冷热号码
* @return void
*/
public function hotColdNumbers()
{
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->getHotColdNumbers($periods, $type);
$this->success('查询成功', null, $result);
}
}
}