最佳答案
我想在 $items
数组中添加新元素,由于某些原因我不想使用连接。
$items = DB::select(DB::raw('SELECT * FROM items WHERE items.id = '.$id.' ;'));
foreach($items as $item){
$product = DB::select(DB::raw(' select * from product
where product_id = '. $id.';' ));
$item->push($product);
}
我该怎么办?