title = '卡号黑名单'; $query = $this->_query($this->table); $query->equal('status,type,value')->dateBetween('create_at'); // 加载对应数据列表 $this->type = input('type', 'all'); // 列表排序并显示 $query->order('status desc,id desc')->page(); } /** * 添加黑名单 * @auth true * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function add() { $this->_applyFormToken(); $this->_form($this->table, 'form'); } /** * 编辑黑名单 * @auth true * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function edit() { $this->_applyFormToken(); $this->_form($this->table, 'form'); } /** * 修改黑名单状态 * @auth true * @throws \think\db\exception\DbException */ public function state() { $this->_applyFormToken(); $this->_save($this->table, $this->_vali([ 'status.in:0,1' => '状态值范围异常!', 'status.require' => '状态值不能为空!', ])); } /** * 删除黑名单 * @auth true * @throws \think\db\exception\DbException */ public function remove() { $this->_applyFormToken(); $this->_delete($this->table); } }