在laravel中,查询数据库后,返回的对象,可以用下面的办法变为数组
$nodes = Db::table('system_node')->orderBy('sort', 'asc')->orderBy('id' ,'asc')->get()->map(function ($value) { return (array)$value; })->toArray();
在laravel中,查询数据库后,返回的对象,可以用下面的办法变为数组
$nodes = Db::table('system_node')->orderBy('sort', 'asc')->orderBy('id' ,'asc')->get()->map(function ($value) { return (array)$value; })->toArray();
转载于:https://www.cnblogs.com/ouzhenzhou/p/7233956.html