orderBy('rid')->get(); $data= array(); if($res->count() > 0){ $res = $res->toArray(); foreach ($res as $key => $v) { $data[$v['rid']] = $v; } } return $data; } /** * 获取闪兑钱包ID和名称列表 [key为ID value为名称] * @param $type [0.列表格式1 1.列表格式2 2.列表格式3] */ public function IDList($type=0){ $data = $this->getList(); $list = []; if(!empty($data)){ switch ($type) { case 1: foreach ($data as $k => $v) { $list[$v['transit_wallet_id']][] = $v; } break; default: foreach ($data as $k => $v) { $list[$v['transit_wallet_id'].strtolower($v['in_coin_name'])] = $v; } break; } } return $list; } }