0
我有兩個型號Bill
& Order
, 我可以通過獲得Orders
記錄:雄辯的支點:如何做選擇列Laravel 5.1
$orders = $bill->orders;
但我想用選擇這樣的:
$orders = $bill->orders->select([
'orders.*',
\DB::raw('sum(orders.quantity) as qty'),
\DB::raw('sum(orders.price) as total')
])
->groupBy('article_id');
我得到這個錯誤:
Method select does not exist.
請任何人都可以幫助我,謝謝!