feat : order info

This commit is contained in:
2025-03-24 10:06:29 +08:00
parent 9860f3eab8
commit 3c91ac4077
4 changed files with 21 additions and 3 deletions

View File

@@ -135,8 +135,8 @@ class OrderInfoService extends BaseService
$skuInfo = $skuList[$item['sku_id']] ?? [];
$imageId = !empty($skuInfo) && !empty(explode(',',$skuInfo['image_ids'])[0]) ? explode(',',$skuInfo['image_ids'])[0] : [];
$skuInfo['url'] = $imageList[$imageId]['url'] ?? '';
$oneCopiesInfo['image_list'][] = $imageList[$imageId] ?? [];
// $skuInfo['url'] = $imageList[$imageId]['url'] ?? '';
// $oneCopiesInfo['image_list'][] = $imageList[$imageId] ?? [];
$oneCopiesInfo['sku_list'][] = [
'url' => $imageList[$imageId]['url'] ?? '',
@@ -144,7 +144,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[$spuList[$skuList[$item['sku_id']]['spu_id']]['chef_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'];