初始化代码
This commit is contained in:
46
application/admin/controller/Block.php
Normal file
46
application/admin/controller/Block.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use think\Controller;
|
||||
use think\facade\Request;
|
||||
|
||||
class Block extends Common
|
||||
{
|
||||
|
||||
|
||||
//获取列表
|
||||
public function get_block_list()
|
||||
{
|
||||
$type = input('type', 0);
|
||||
$type_text = input('type_text', '');
|
||||
$is_delete = input('is_delete', 0);
|
||||
$page = input('page', 1);
|
||||
$limit = input('limit', 20);
|
||||
$reslut = model('Block')->get_block_list($type, $type_text, $is_delete, $page, $limit);
|
||||
$data = [];
|
||||
$data['code'] = 0;
|
||||
$data['msg'] = '获取成功';
|
||||
$data['count'] = $reslut['data']['count'];
|
||||
$data['data'] = $reslut['data']['list'];
|
||||
return json($data);
|
||||
}
|
||||
|
||||
//添加封禁
|
||||
public function add_block(){
|
||||
$aid = $this->aid;
|
||||
$data = input('post.');
|
||||
$reslut = model('Block')->add_block($aid, $data);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
}
|
||||
|
||||
//移除封禁
|
||||
public function del_block(){
|
||||
$id = input('id', 0);
|
||||
$reslut = model('Block')->del_block($id);
|
||||
return ajaxReturn($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user