|
...
|
...
|
@@ -46,9 +46,9 @@ class TicketController extends BaseController |
|
|
|
{
|
|
|
|
$request->validated();
|
|
|
|
$project = TicketProject::where('uuid', $project_id)->first();
|
|
|
|
if (!$project) return $this->error('未找到项目', 404);
|
|
|
|
if ($project->is_del) return $this->error('项目状态异常', 400);
|
|
|
|
if (empty($project->engineer_id)) return $this->error('项目未分配工单负责人', 400);
|
|
|
|
if (!$project) return response('未找到项目', 404);
|
|
|
|
if ($project->is_del) return response('项目状态异常', 400);
|
|
|
|
if (empty($project->first_engineer)) return response('项目未分配工单负责人', 400);
|
|
|
|
|
|
|
|
$result = DB::transaction(function () use ($request, $project) {
|
|
|
|
$ticket = new Tickets();
|
|
...
|
...
|
@@ -87,11 +87,11 @@ class TicketController extends BaseController |
|
|
|
])
|
|
|
|
->find($id);
|
|
|
|
|
|
|
|
if (!$ticket) return $this->error('工单未找到', 404);
|
|
|
|
if (!$ticket) return response('工单未找到', 404);
|
|
|
|
|
|
|
|
if ($ticket->project->uuid !== $project_id) return $this->error('无权限查看该工单', 403);
|
|
|
|
if ($ticket->project->uuid !== $project_id) return response('无权限查看该工单', 403);
|
|
|
|
|
|
|
|
if ($ticket->project->is_del) return $this->error('项目状态异常', 400);
|
|
|
|
if ($ticket->project->is_del) return response('项目状态异常', 400);
|
|
|
|
|
|
|
|
return response()->json(['data' => $ticket]);
|
|
|
|
}
|
|
...
|
...
|
@@ -128,7 +128,7 @@ class TicketController extends BaseController |
|
|
|
'first_engineer:id,name',
|
|
|
|
])
|
|
|
|
->where('uuid', $project_id)->first();
|
|
|
|
if (!$project) return $this->error('未找到项目', 404);
|
|
|
|
if (!$project) return $this->response('未找到项目', 404);
|
|
|
|
return response()->json(['data' => $project]);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|