...
|
...
|
@@ -415,6 +415,7 @@ class CartModel |
|
|
$oneGoods['gift'] = true;
|
|
|
} elseif ($single['goods_type'] == 'price_gift') {
|
|
|
$oneGoods['advanceBuy'] = true;
|
|
|
$oneGoods['price'] = Helpers::transPrice($single['sale_price']);
|
|
|
}
|
|
|
|
|
|
$result['goods'][] = $oneGoods;
|
...
|
...
|
@@ -440,7 +441,8 @@ class CartModel |
|
|
}
|
|
|
|
|
|
// 有货币
|
|
|
$result['yohoCoin'] = (isset($orderCompute['use_yoho_coin']) && !empty($orderCompute['use_yoho_coin'])) ? $orderCompute['use_yoho_coin'] : $payReturn['yoho_coin'];
|
|
|
$result['yohoCoin'] = $payReturn['yoho_coin'];
|
|
|
$result['useYohoCoin'] = isset($orderCompute['use_yoho_coin']) ? $orderCompute['use_yoho_coin'] : $payReturn['yoho_coin'];
|
|
|
|
|
|
// 订单数据
|
|
|
if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) {
|
...
|
...
|
@@ -662,16 +664,9 @@ class CartModel |
|
|
$colorNum += $one['storage_number'];
|
|
|
$sizeStorageStr .= $one['storage_number'] . '/';
|
|
|
|
|
|
$sizeList[$val['color_id']][] = $oneSize;
|
|
|
$sizeList[$val['product_skc']][] = $oneSize;
|
|
|
|
|
|
$colorStorageGroup[$one['size_name']][$val['color_name']] = $one['storage_number'];
|
|
|
}
|
|
|
|
|
|
// 统计尺码对应的各个颜色的库存量
|
|
|
foreach ($sizes as $colorId => $sizeArr) {
|
|
|
foreach ($sizeArr as $key => $value) {
|
|
|
$sizeList[$colorId][$key]['colorNumStr'] = implode('/', array_values($colorStorageGroup[ $sizeArr['name'] ]) );
|
|
|
}
|
|
|
$colorStorageGroup[$val['product_skc']][$one['size_name']] = $one['storage_number'];
|
|
|
}
|
|
|
|
|
|
// 颜色
|
...
|
...
|
@@ -695,9 +690,24 @@ class CartModel |
|
|
$totalStorageNum += $colorNum;
|
|
|
}
|
|
|
|
|
|
// 遍历所有尺码,统计出该尺码的每个颜色的库存量,没有时添0,不能空着,因为JS中需要判断
|
|
|
foreach ($sizeList as $skc => $sizeArr) {
|
|
|
foreach ($sizeArr as $key => $value) {
|
|
|
$sizeStorageStr = '';
|
|
|
foreach ($colorStorageGroup as $colorArr) {
|
|
|
if (isset($colorArr[ $value['name'] ])) {
|
|
|
$sizeStorageStr .= $colorArr[ $value['name'] ] . '/';
|
|
|
} else {
|
|
|
$sizeStorageStr .= '0/';
|
|
|
}
|
|
|
}
|
|
|
$sizeList[$skc][$key]['colorNumStr'] = rtrim($sizeStorageStr, '/');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 格式化尺码对应的各个颜色分组
|
|
|
foreach ($colors as $color) {
|
|
|
$sizes[]['size'] = $sizeList[$color['id']];
|
|
|
$sizes[]['size'] = $sizeList[$color['skcId']];
|
|
|
}
|
|
|
|
|
|
$data['thumbs'] = $thumbImageList;
|
...
|
...
|
|