工单状态

This commit is contained in:
2025-07-29 11:51:00 +08:00
parent 78cfb92a9e
commit 69e79c0e74
2 changed files with 14 additions and 0 deletions
@@ -75,6 +75,7 @@ class TicketController extends BaseController
public function getStatus(Request $request)
{
try {
$request->setGet('user_id', $request->user->uid);
$result = (new TicketService())->getStatus($request->all());
return $result
? $this->success($result)
+13
View File
@@ -129,6 +129,19 @@ class TicketService
foreach ($ticket_status as $key => $value) {
$status[] = ['value' => $key, 'text' => $value];
}
if (empty($data['id'])) {
return $status;
}
$res = (new TicketLogic())->find($data['id']);
if(!empty($res) && $res->user_id == $data['user_id']){
$status = [
['value' => Constants::TICKET_STATUS['PENDING'], 'text' => $ticket_status[Constants::TICKET_STATUS['PENDING']]],
['value' => Constants::TICKET_STATUS['REJECTED'], 'text' => $ticket_status[Constants::TICKET_STATUS['REJECTED']]],
];
}
return $status;
}
}