diff --git a/app/Model/OrderGood.php b/app/Model/OrderGood.php index 6ac115a..a48b198 100644 --- a/app/Model/OrderGood.php +++ b/app/Model/OrderGood.php @@ -50,6 +50,6 @@ class OrderGood extends Model */ public function getGoodIdsByOrderId(int $orderId): array { - return $this->where('order_id', $orderId)->select('sku_id','SUM(`quantity`) as `quantity`')->get()->toArray(); + return $this->where('order_id', $orderId)->select('sku_id')->selectRaw('SUM(`quantity`) as `quantity`')->get()->toArray(); } }