feat : sts
This commit is contained in:
@@ -126,6 +126,25 @@ class OptionalListService extends BaseService
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($purchaseData)) {
|
if (!empty($purchaseData)) {
|
||||||
|
if (empty($skuList)) throw new ErrException('数据错误');
|
||||||
|
|
||||||
|
foreach ($purchaseData as &$one) {
|
||||||
|
$onePurchaseSkuIds = explode(',',$one['sku_ids']);
|
||||||
|
$onePurchaseSkuList = [];
|
||||||
|
$onePurchaseSkuPrice = 0;
|
||||||
|
$onePurchaseSkuNames = [];
|
||||||
|
|
||||||
|
foreach ($onePurchaseSkuIds as $skuId) {
|
||||||
|
$onePurchaseSkuList[] = $skuList[$skuId];
|
||||||
|
$onePurchaseSkuPrice = bcadd((string)$onePurchaseSkuPrice, (string)$onePurchaseSkuList[$skuId]['price'], 2);
|
||||||
|
$onePurchaseSkuNames[] = $skuList[$skuId]['name'] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$one['purchase_sku_list'] = $onePurchaseSkuList;
|
||||||
|
$one['purchase_sku_price'] = $onePurchaseSkuPrice;
|
||||||
|
$one['purchase_sku_names'] = $onePurchaseSkuNames;
|
||||||
|
}
|
||||||
|
|
||||||
array_unshift($res,[
|
array_unshift($res,[
|
||||||
'category_name' => $this->configCache->getConfigValueByKey(ConfigCode::ONE_CLICK_SHOPPING_FOR_CATEGORY_NAME),
|
'category_name' => $this->configCache->getConfigValueByKey(ConfigCode::ONE_CLICK_SHOPPING_FOR_CATEGORY_NAME),
|
||||||
'category_image' => $this->getOssObjectById((int)$this->configCache->getConfigValueByKey(ConfigCode::ONE_CLICK_SHOPPING_FOR_CATEGORY_IMAGE)),
|
'category_image' => $this->getOssObjectById((int)$this->configCache->getConfigValueByKey(ConfigCode::ONE_CLICK_SHOPPING_FOR_CATEGORY_IMAGE)),
|
||||||
|
|||||||
Reference in New Issue
Block a user