修改工单校验
This commit is contained in:
@@ -55,8 +55,20 @@ class TicketService
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
Db::beginTransaction();
|
Db::beginTransaction();
|
||||||
$attachment = $data['attachment']??[];
|
|
||||||
$logic = new TicketLogic();
|
$logic = new TicketLogic();
|
||||||
|
$result = $logic->find($data['id']);
|
||||||
|
|
||||||
|
if(empty($result)){
|
||||||
|
throw new BusinessException('工单不存在');
|
||||||
|
}
|
||||||
|
if($result['user_id'] != $data['user_id']){
|
||||||
|
throw new BusinessException('只能编辑自己的工单');
|
||||||
|
}
|
||||||
|
if($result['status'] != 1){
|
||||||
|
throw new BusinessException('只能修改待受理工单');
|
||||||
|
}
|
||||||
|
|
||||||
|
$attachment = $data['attachment']??[];
|
||||||
$result = $logic->edit($data);
|
$result = $logic->edit($data);
|
||||||
|
|
||||||
if(!empty($attachment)){
|
if(!empty($attachment)){
|
||||||
|
|||||||
Reference in New Issue
Block a user