feat : order

This commit is contained in:
2025-03-04 16:20:42 +08:00
parent 3dcb545952
commit 8b67fccf64
2 changed files with 2 additions and 1 deletions

View File

@@ -50,6 +50,6 @@ class OrderGood extends Model
*/
public function getGoodIdsByOrderId(int $orderId): array
{
return $this->where('order_id', $orderId)->select('sku_id')->selectRaw('SUM(`quantity`) as `quantity`')->get()->toArray();
return $this->where('order_id', $orderId)->select('sku_id')->selectRaw('SUM(`quantity`) as `quantity`')->groupBy('sku_id')->get()->toArray();
}
}