修改工单校验

This commit is contained in:
2025-07-11 18:09:36 +08:00
parent a6ab359db4
commit f2b0181629
+13 -1
View File
@@ -55,8 +55,20 @@ class TicketService
{
try {
Db::beginTransaction();
$attachment = $data['attachment']??[];
$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);
if(!empty($attachment)){