mirror of
				https://github.com/v2board/v2board.git
				synced 2025-11-01 01:41:47 +08:00 
			
		
		
		
	update
This commit is contained in:
		| @@ -13,6 +13,18 @@ use Illuminate\Support\Facades\DB; | |||||||
| class TicketController extends Controller | class TicketController extends Controller | ||||||
| { | { | ||||||
|     public function index (Request $request) { |     public function index (Request $request) { | ||||||
|  |         if ($request->input('id')) { | ||||||
|  |             $ticket = Ticket::where('id', $request->input('id')) | ||||||
|  |                 ->where('user_id', $request->session()->get('id')) | ||||||
|  |                 ->first(); | ||||||
|  |             if (!$ticket) { | ||||||
|  |                 abort(500, '工单不存在'); | ||||||
|  |             } | ||||||
|  |             $ticket['message'] = TicketMessage::where('ticket_id', $ticket->id)->get(); | ||||||
|  |             return response([ | ||||||
|  |                 'data' => $ticket | ||||||
|  |             ]); | ||||||
|  |         } | ||||||
|         return response([ |         return response([ | ||||||
|             'data' => Ticket::where('user_id', $request->session()->get('id')) |             'data' => Ticket::where('user_id', $request->session()->get('id')) | ||||||
|                 ->orderBy('created_at', 'DESC') |                 ->orderBy('created_at', 'DESC') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user