You've already forked guangan
Dept
This commit is contained in:
47
plugs/think-plugs-ticket/src/controller/Dept.php
Normal file
47
plugs/think-plugs-ticket/src/controller/Dept.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace plugin\ticket\controller;
|
||||
|
||||
use plugin\ticket\model\TicketDept;
|
||||
use think\admin\Controller;
|
||||
use think\admin\helper\QueryHelper;
|
||||
|
||||
class Dept extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$this->title = '部门管理';
|
||||
TicketDept::mQuery()->layTable(function () {
|
||||
|
||||
}, function (QueryHelper $query) {
|
||||
$query->like('name')->equal('status');
|
||||
});
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
$this->title = '添加部门';
|
||||
TicketDept::mForm('form');
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
$this->title = '编辑部门';
|
||||
TicketDept::mForm('form');
|
||||
}
|
||||
|
||||
public function remove()
|
||||
{
|
||||
$this->_applyFormToken();
|
||||
TicketDept::mDelete('id');
|
||||
}
|
||||
|
||||
public function status()
|
||||
{
|
||||
TicketDept::mSave($this->_vali([
|
||||
'id.require' => '部门ID不能为空',
|
||||
'status.in:0,1' => '状态值范围异常!',
|
||||
'status.require' => '状态值不能为空!',
|
||||
]), 'id');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user