This commit is contained in:
2025-03-26 15:22:03 +08:00
parent 4a3911ba12
commit 92cc1c27f3
16 changed files with 565 additions and 227 deletions

View File

@ -29,6 +29,9 @@ class Ticket extends Auth
$ticket_address = $this->request->post('ticket_address');
$imgs = $this->request->post('imgs');
$work_days = $this->request->post('work_days');
$gc_content = $this->request->post('gc_content');
$zf_content = $this->request->post('zf_content');
$ys_content = $this->request->post('ys_content');
$data = [
'user_id' => $this->staff->id,
'type_id' => $type_id,
@ -42,6 +45,9 @@ class Ticket extends Auth
'contact_name' => $this->staff->name,
'contact_phone' => $this->staff->phone,
'status' => 0,
'gc_content' => $gc_content,
'zf_content' => $zf_content,
'ys_content' => $ys_content,
'work_days' => $work_days
];
if (!empty($record)) {
@ -49,6 +55,29 @@ class Ticket extends Auth
} else {
$ticket = TicketInspectionShare::create($data);
}
$tTicket = $ticket->linkedTicket()->save([
'source_type' => 2,
'type_id' => $data['type_id'],
'user_type' => 'staff',
'user_id' => $ticket->user_id,
'title' => $ticket->title,
'content' => $ticket->content,
'ticket_region' => $ticket->ticket_region,
'ticket_address' => $ticket->ticket_address,
'contact_name' => $ticket->contact_name,
'contact_phone' => $ticket->contact_phone,
'lat' => $ticket->ticket_lat,
'lng' => $ticket->ticket_lng,
'imgs' => $ticket->imgs,
'status' => 0, // 先审核
'gc_content' => $gc_content,
'zf_content' => $zf_content,
'ys_content' => $ys_content,
'work_days' => $work_days
]);
$ticket->linked_ticket_id = $tTicket->id;
$ticket->status = 1;
$ticket->save();
$this->success("工单创建成功", $ticket);
}