You've already forked guangan
工单位置详情
This commit is contained in:
83
plugs/think-plugs-ticket/src/controller/View.php
Normal file
83
plugs/think-plugs-ticket/src/controller/View.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user