Explorar o código

update: ticket save lock

tokumeikoi %!s(int64=3) %!d(string=hai) anos
pai
achega
f439040375
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/Http/Controllers/User/TicketController.php

+ 1 - 1
app/Http/Controllers/User/TicketController.php

@@ -55,7 +55,7 @@ class TicketController extends Controller
     public function save(TicketSave $request)
     public function save(TicketSave $request)
     {
     {
         DB::beginTransaction();
         DB::beginTransaction();
-        if ((int)Ticket::where('status', 0)->where('user_id', $request->session()->get('id'))->count()) {
+        if ((int)Ticket::where('status', 0)->where('user_id', $request->session()->get('id'))->lockForUpdate()->count()) {
             abort(500, __('There are other unresolved tickets'));
             abort(500, __('There are other unresolved tickets'));
         }
         }
         $ticket = Ticket::create(array_merge($request->only([
         $ticket = Ticket::create(array_merge($request->only([