This commit is contained in:
2026-08-05 17:38:29 +08:00
parent e831ce810b
commit 98b60c333a
5 changed files with 145 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ namespace app\admin\controller;
use app\BaseController;
use app\common\model\Tickets;
use app\common\service\TicketNotifier;
use app\common\service\TicketService;
use think\facade\Session;
@@ -109,8 +110,14 @@ class Ticket extends BaseController
$ticket = Tickets::find($id);
if (!$ticket) return $this->error('工单不存在');
return $ticket->delete()
? $this->success('删除成功', [])
: $this->error('删除失败', []);
$deleted = $ticket->delete();
if (!$deleted) {
return $this->error('删除失败', []);
}
// 通知前端实时刷新(静默,广播服务不可用不影响删除流程)
TicketNotifier::notify($id, 'delete');
return $this->success('删除成功', []);
}
}