mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 17:31:49 +08:00 
			
		
		
		
	update
This commit is contained in:
		| @@ -11,6 +11,27 @@ use Illuminate\Support\Facades\Redis; | |||||||
| 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')) | ||||||
|  |                 ->first(); | ||||||
|  |             if (!$ticket) { | ||||||
|  |                 abort(500, '工单不存在'); | ||||||
|  |             } | ||||||
|  |             $ticket['message'] = TicketMessage::where('ticket_id', $ticket->id)->get(); | ||||||
|  |             for ($i = 0; $i < count($ticket['message']); $i++) { | ||||||
|  |                 if ($ticket['message'][$i]['user_id'] == $request->session()->get('id')) { | ||||||
|  |                     $ticket['message'][$i]['is_me'] = true; | ||||||
|  |                 } else { | ||||||
|  |                     $ticket['message'][$i]['is_me'] = false; | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |             return response([ | ||||||
|  |                 'data' => $ticket | ||||||
|  |             ]); | ||||||
|  |         } | ||||||
|  |         return response([ | ||||||
|  |             'data' => Ticket::orderBy('created_at', 'DESC') | ||||||
|  |                 ->get() | ||||||
|  |         ]); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -49,6 +49,8 @@ Route::prefix('v1') | |||||||
|                 Route::post('notice/save', 'Admin\\NoticeController@save'); |                 Route::post('notice/save', 'Admin\\NoticeController@save'); | ||||||
|                 Route::post('notice/update', 'Admin\\NoticeController@update'); |                 Route::post('notice/update', 'Admin\\NoticeController@update'); | ||||||
|                 Route::post('notice/drop', 'Admin\\NoticeController@drop'); |                 Route::post('notice/drop', 'Admin\\NoticeController@drop'); | ||||||
|  |                 // Ticket | ||||||
|  |                 Route::get('ticket', 'Admin\\TicketController@index'); | ||||||
|             }); |             }); | ||||||
|         // User |         // User | ||||||
|         Route::prefix('user') |         Route::prefix('user') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user