1
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?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'];
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user