You've already forked guangan
83 lines
1.8 KiB
PHP
83 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace plugin\ticket\controller;
|
|
|
|
use plugin\ticket\model\TicketView;
|
|
use think\admin\Controller;
|
|
use think\admin\helper\QueryHelper;
|
|
|
|
/**
|
|
* 查看工单管理
|
|
*/
|
|
class View extends Controller
|
|
{
|
|
/**
|
|
* 查看工单列表
|
|
* @auth true
|
|
* @menu true
|
|
* @return void
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
*/
|
|
public function index()
|
|
{
|
|
$this->title = '查看工单管理';
|
|
TicketView::mQuery()->layTable(function () {
|
|
}, static function (QueryHelper $query) {
|
|
$query->equal('status')->like('title');
|
|
$query->timeBetween('create_at');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 添加查看工单
|
|
* @auth true
|
|
* @menu true
|
|
* @return void
|
|
*/
|
|
public function add()
|
|
{
|
|
$this->title = '添加查看工单';
|
|
TicketView::mForm('form');
|
|
}
|
|
|
|
/**
|
|
* 编辑查看工单
|
|
* @auth true
|
|
* @menu true
|
|
* @return void
|
|
*/
|
|
public function edit()
|
|
{
|
|
$this->title = '编辑查看工单';
|
|
$this->id = $this->request->param('id');
|
|
TicketView::mForm('form', 'id');
|
|
}
|
|
|
|
/**
|
|
* 删除查看工单
|
|
* @auth true
|
|
* @menu true
|
|
* @return void
|
|
*/
|
|
public function remove()
|
|
{
|
|
TicketView::mDelete('id');
|
|
}
|
|
|
|
/**
|
|
* 修改查看工单状态
|
|
* @auth true
|
|
* @menu true
|
|
* @return void
|
|
*/
|
|
public function status()
|
|
{
|
|
TicketView::mSave($this->_vali([
|
|
'id.require' => '工单ID不能为空',
|
|
'status.in:0,1' => '状态值范围异常!',
|
|
'status.require' => '状态值不能为空!',
|
|
]), 'id');
|
|
}
|
|
} |