feat : order list

This commit is contained in:
2025-04-07 10:03:14 +08:00
parent 09ff94cae5
commit 6925fe7b23
5 changed files with 31 additions and 15 deletions

View File

@@ -114,11 +114,7 @@ class OrderInfoService extends BaseService
$skuList = array_column($skuList, null,'id');
$imageList = $this->getOssObjects(array_column($skuList,'image_ids'));
$spuIds = array_unique(array_column($skuList,'spu_id'));
$spuList = $this->spuModel->getDataArrByIds($spuIds);
$spuList = array_column($spuList, null,'id');
$chefId = array_unique(array_column($spuList,'chef_id'));
$chefId = array_unique(array_column($skuList,'chef_id'));
$chefList = $this->adminUserModel->getDataArrByIds($chefId);
$chefList = array_column($chefList, null,'id');
@@ -169,7 +165,7 @@ class OrderInfoService extends BaseService
'unit_price' => $item['unit_price'],
'quantity' => $item['quantity'],
'price' => bcmul((string)$item['unit_price'], (string)$item['quantity'], 2),
'chef_name' => $chefList[$spuList[$skuList[$item['sku_id']]['spu_id']]['chef_id']]['chinese_name'] ?? '',
'chef_name' => $chefList[$item['sku_id']]['chinese_name'] ?? '',
];
$oneCopiesInfo['total_price'] = bcadd((string)$oneCopiesInfo['total_price'], bcmul((string)$item['unit_price'],(string)$item['quantity'],2), 2);
$oneCopiesInfo['total_quantity'] += $item['quantity'];