代码:
$list = DB::table('goodsshops')
->join('users', 'users.id', '=', 'goodsshops.shop_id')
->select('users.id','users.name',DB::raw('group_concat(goodsshops.id) as cart_id'))
->where('goodsshops.user_id',$user->id)
->groupBy('goodsshops.shop_id')
->get()
->toArray();
dd($list);
错误信息:
Call to a member function toArray() on array
也就是DB join时怎么返回 数组...