Tokumeikoi 5 years ago
parent
commit
7c69e19304
1 changed files with 3 additions and 0 deletions
  1. 3 0
      app/Http/Controllers/User/TicketController.php

+ 3 - 0
app/Http/Controllers/User/TicketController.php

@@ -51,6 +51,9 @@ class TicketController extends Controller
     public function save(TicketSave $request)
     {
         DB::beginTransaction();
+        if ((int)Ticket::where('status', 0)->count()) {
+            abort(500, '存在其他工单尚未处理');
+        }
         $ticket = Ticket::create(array_merge($request->only([
             'subject',
             'level'