This commit is contained in:
2026-08-08 16:28:22 +08:00
parent d4c08a8cdf
commit b8cd7e7658
2 changed files with 8 additions and 3 deletions

View File

@@ -61,8 +61,8 @@ class TicketService
*/
public function createTicket(array $data)
{
if (isset($data['website']) && $data['website'] === '') { // isset检查键存在且不为null
throw new \Exception('网站不能为空');
if (!isset($data['website']) || trim((string)$data['website'] === '')) { // isset检查键存在且不为null
throw new \Exception('网站输入不能为空');
}
$website = trim($data['website']);
@@ -72,7 +72,9 @@ class TicketService
->find();
if ($unfinishedTicket) {
throw new \Exception('已存在未完成的同网站工单,无法创建');
if (empty($data['confirm'])) {
throw new \Exception('已存在未分配或进行中的相同工单,是否继续创建?', 409);
}
}
// 当前无相同网站