账单导出
This commit is contained in:
@@ -29,24 +29,6 @@ class BillDetailService
|
||||
return $this->aggregateItems($items);
|
||||
}
|
||||
|
||||
/**
|
||||
* 合并后的商品明细(跨账单口径):按商品聚合多张账单的全部订单明细
|
||||
* 用于账单合并导出,单价同为加权平均口径
|
||||
*
|
||||
* @param array<int, int> $billIds 账单ID列表
|
||||
* @return array<int, array{product_id: int, product_name: string, product_spec: string, unit: string, price: string, quantity: int, weight: string, amount: string, image: string}>
|
||||
*/
|
||||
public function mergedItemsOfBills(array $billIds): array
|
||||
{
|
||||
$items = StoreOrderItemModel::query()
|
||||
->whereIn('bill_id', $billIds)
|
||||
->where('quantity', '>', 0)
|
||||
->orderBy('id')
|
||||
->get();
|
||||
|
||||
return $this->aggregateItems($items);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按商品聚合订单明细:数量累加、重量/金额 bc 累加、单价加权平均,
|
||||
* 首图取明细快照 image_ids 批量解析,按「分类sort → 商品sort」排序
|
||||
|
||||
Reference in New Issue
Block a user