9881f75e59
改为批量查询模式:每期特码相对于它前面N期的出现频率判定冷热 弹窗内以表格形式展示所有期号、特码球、冷热标签、次数、排名 支持调整向前期数(10-100),打开弹窗自动查询
275 lines
8.6 KiB
PHP
275 lines
8.6 KiB
PHP
<?php
|
|
|
|
namespace app\admin\controller;
|
|
|
|
use app\common\controller\Backend;
|
|
|
|
/**
|
|
*
|
|
*
|
|
* @icon fa fa-circle-o
|
|
*/
|
|
class History extends Backend
|
|
{
|
|
|
|
/**
|
|
* History模型对象
|
|
* @var \app\admin\model\History
|
|
*/
|
|
protected $model = null;
|
|
|
|
/**
|
|
* 无需额外权限检查的方法(但仍在 admin 模块内,需要 admin 登录)
|
|
* @var array
|
|
*/
|
|
protected $noNeedRight = ['missingNum', 'trendData', 'hotColdNumbers', 'colorWaveAnalysis', 'zodiacAnalysis', 'oddEvenAnalysis', 'bigSmallAnalysis', 'specialTrend', 'consecutiveNumbers', 'tailNumbers', 'dashboard', 'specialHeatmap', 'specialHotColdAction'];
|
|
|
|
public function _initialize()
|
|
{
|
|
parent::_initialize();
|
|
$this->model = new \app\admin\model\History;
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
* 查询遗漏号码
|
|
* @return void
|
|
*/
|
|
public function missingNum()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$periods = $this->request->get('periods', 10, 'intval');
|
|
if ($periods < 1 || $periods > 100) {
|
|
$this->error('期数范围必须在 1-100 之间');
|
|
}
|
|
$type = $this->request->get('type', 'all');
|
|
if (!in_array($type, ['all', 'special'])) {
|
|
$this->error('查询类型不正确');
|
|
}
|
|
$result = $this->model->getMissingNumbers($periods, $type);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 获取走势图数据
|
|
* @return void
|
|
*/
|
|
public function trendData()
|
|
{
|
|
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->getTrendData($periods, $type);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 获取冷热号码
|
|
* @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);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 波色分析
|
|
*/
|
|
public function colorWaveAnalysis()
|
|
{
|
|
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->getColorWaveAnalysis($periods, $type);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 生肖分析
|
|
*/
|
|
public function zodiacAnalysis()
|
|
{
|
|
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->getZodiacAnalysis($periods, $type);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 奇偶分析
|
|
*/
|
|
public function oddEvenAnalysis()
|
|
{
|
|
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->getOddEvenAnalysis($periods, $type);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 大小分析
|
|
*/
|
|
public function bigSmallAnalysis()
|
|
{
|
|
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->getBigSmallAnalysis($periods, $type);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 特码走势
|
|
*/
|
|
public function specialTrend()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$periods = $this->request->get('periods', 30, 'intval');
|
|
if ($periods < 10 || $periods > 100) {
|
|
$this->error('期数范围必须在 10-100 之间');
|
|
}
|
|
$result = $this->model->getSpecialTrend($periods);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 连号分析
|
|
*/
|
|
public function consecutiveNumbers()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$periods = $this->request->get('periods', 30, 'intval');
|
|
if ($periods < 10 || $periods > 100) {
|
|
$this->error('期数范围必须在 10-100 之间');
|
|
}
|
|
$result = $this->model->getConsecutiveNumbers($periods);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 尾数分析
|
|
*/
|
|
public function tailNumbers()
|
|
{
|
|
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->getTailNumbers($periods, $type);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 综合统计面板
|
|
*/
|
|
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);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 特码冷热列表(每期相对于前N期的冷热状态)
|
|
*/
|
|
public function specialHotColdAction()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$lookback = $this->request->get('lookback', 30, 'intval');
|
|
if ($lookback < 10 || $lookback > 100) {
|
|
$this->error('向前期数范围必须在 10-100 之间');
|
|
}
|
|
$limit = $this->request->get('limit', 100, 'intval');
|
|
if ($limit < 10 || $limit > 200) {
|
|
$this->error('查询期数范围必须在 10-200 之间');
|
|
}
|
|
$result = $this->model->getSpecialHotColdList($lookback, $limit);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 特码热力图
|
|
*/
|
|
public function specialHeatmap()
|
|
{
|
|
if ($this->request->isAjax()) {
|
|
$periods = $this->request->get('periods', 30, 'intval');
|
|
if ($periods < 10 || $periods > 100) {
|
|
$this->error('期数范围必须在 10-100 之间');
|
|
}
|
|
$result = $this->model->getSpecialHeatmap($periods);
|
|
$this->success('查询成功', null, $result);
|
|
}
|
|
}
|
|
|
|
|
|
}
|