feat: add tags to plans, refactor order service, adn fix ticket lock
This commit is contained in:
1 parent
0863277424
commit
03a55bdd77
13 files changed
+208
-97
No files matched your search
@@ -43,8 +43,9 @@ class TicketController extends Controller
|
||||
{
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
if ((int)Ticket::where('status', 0)->where('user_id', $request->user()->id)->lockForUpdate()->count()) {
|
||||
throw new \Exception(__('There are other unresolved tickets'));
|
||||
if (Ticket::where('status', 0)->where('user_id', $request->user()->id)->lockForUpdate()->first()) {
|
||||
DB::rollBack();
|
||||
return $this->fail([400, '存在未关闭的工单']);
|
||||
}
|
||||
$ticket = Ticket::create(array_merge($request->only([
|
||||
'subject',
|
||||
|
||||
Reference in new issue
Block a user