$playersArray = DB::table('sign_up')
->select('user_id', 'nickname')
->where('order_id', '=', $request->id)
->where('nickname', '<>', '')
->get()
->toarray();
$playersObj = \array_combine(array_column($playersArray, 'user_id'), \array_column($playersArray, 'nickname'));
标签:映射,column,playersArray,user,表里,array,PHP,nickname,id
From: https://www.cnblogs.com/sunr/p/17855608.html