+
+ {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
+
+ {{/if}}
+ {{php}}
+ $hook_name = 'plugins_view_buy_group_goods_inside_top';
+ $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$v]);
+ if(!empty($hook_data) && is_array($hook_data))
+ {
+ foreach($hook_data as $hook)
+ {
+ if(is_string($hook) || is_int($hook))
+ {
+ echo htmlspecialchars_decode($hook);
+ }
+ }
+ }
+ {{/php}}
+
{{if !empty($v['goods_items'])}}
@@ -331,8 +352,43 @@
没有商品
{{/if}}
-
+
+
+
+ {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
+
+ plugins_view_buy_group_goods_inside_bottom
+
+ {{/if}}
+ {{php}}
+ $hook_name = 'plugins_view_buy_group_goods_inside_bottom';
+ $hook_data = Hook::listen($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$v]);
+ if(!empty($hook_data) && is_array($hook_data))
+ {
+ foreach($hook_data as $hook)
+ {
+ if(is_string($hook) || is_int($hook))
+ {
+ echo htmlspecialchars_decode($hook);
+ }
+ }
+ }
+ {{/php}}
+
+
+ {{if !empty($v['extension_data'])}}
+
+ {{foreach $v['extension_data'] as $ext}}
+ -
+ {{$ext.name}}
+ {{$ext.tips}}
+
+ {{/foreach}}
+
+ {{/if}}
+
+
合计 {{$price_symbol}}{{$v.items_total_price}}
@@ -347,14 +403,14 @@
{{/if}}
-
+
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
- plugins_view_buy_goods_bottom
+ plugins_view_buy_group_goods_bottom
{{/if}}
- {{if !empty($plugins_view_buy_goods_bottom_data) and is_array($plugins_view_buy_goods_bottom_data)}}
- {{foreach $plugins_view_buy_goods_bottom_data as $hook}}
+ {{if !empty($plugins_view_buy_group_goods_bottom_data) and is_array($plugins_view_buy_group_goods_bottom_data)}}
+ {{foreach $plugins_view_buy_group_goods_bottom_data as $hook}}
{{if is_string($hook) or is_int($hook)}}
{{$hook|raw}}
{{/if}}
@@ -383,18 +439,6 @@
{{/foreach}}
{{/if}}
-
- {{if !empty($extension_data)}}
-
- {{foreach $extension_data as $ext}}
- -
- {{$ext.name}}
- {{$ext.tips}}
-
- {{/foreach}}
-
- {{/if}}
-
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
diff --git a/application/service/BuyService.php b/application/service/BuyService.php
index b7cafc931..9b147694e 100755
--- a/application/service/BuyService.php
+++ b/application/service/BuyService.php
@@ -712,7 +712,7 @@ class BuyService
}
// 订单拆分
- $order_split = OrderSplitService::Run(['goods'=>$goods]);
+ $order_split = OrderSplitService::Run(['goods'=>$goods, 'params'=>$params]);
if($order_split['code'] != 0)
{
return $order_split;
@@ -755,29 +755,10 @@ class BuyService
'common_site_type' => $common_site_type,
];
- // 扩展展示数据
- // name 名称
- // price 金额
- // type 类型(0减少, 1增加)
- // tips 提示信息
- // business 业务类型(内容格式不限)
- // ext 扩展数据(内容格式不限)
- $extension_data = [
- // [
- // 'name' => '感恩节9折',
- // 'price' => 23,
- // 'type' => 0,
- // 'tips' => '-¥23元',
- // 'business' => null,
- // 'ext' => null,
- // ],
- ];
-
// 返回数据
$result = [
'goods' => $order_split['data'],
'base' => $base,
- 'extension_data' => $extension_data,
];
// 生成订单数据处理钩子
diff --git a/application/service/OrderSplitService.php b/application/service/OrderSplitService.php
index 94dcd4d7c..42ea0b116 100644
--- a/application/service/OrderSplitService.php
+++ b/application/service/OrderSplitService.php
@@ -54,8 +54,8 @@ class OrderSplitService
}
// 商品仓库集合
- $warehouse_goods = self::GoodsWarehouseAggregate($params['goods']);
- return DataReturn('操作成功', 0, $warehouse_goods);
+ $data = self::GoodsWarehouseAggregate($params['goods']);
+ return DataReturn('操作成功', 0, $data);
}
/**
@@ -69,21 +69,30 @@ class OrderSplitService
*/
public static function GoodsWarehouseAggregate($data)
{
+ // 仓库组扩展展示数据
+ // name 名称
+ // price 金额
+ // type 类型(0减少, 1增加)
+ // tips 提示信息
+ // business 业务类型(内容格式不限)
+ // ext 扩展数据(内容格式不限)
+ // $extension_data = [
+ // [
+ // 'name' => '感恩节9折',
+ // 'price' => 23,
+ // 'type' => 0,
+ // 'tips' => '-¥23元',
+ // 'business' => null,
+ // 'ext' => null,
+ // ],
+ // ];
+
+ // 数据分组
$result = [];
foreach($data as $v)
{
// 不存在规格则使用默认
- if(empty($v['spec']))
- {
- $spec = [
- [
- 'type' => '默认规格',
- 'value' => 'default',
- ]
- ];
- } else {
- $spec = $v['spec'];
- }
+ $spec = empty($v['spec']) ? [['type' => '默认规格','value' => 'default']] : $v['spec'];
// 获取商品库存
$where = [
@@ -128,6 +137,16 @@ class OrderSplitService
// 仓库
$warehouse_handle = WarehouseService::DataHandle([$w]);
$result[$w['id']] = $warehouse_handle[0];
+ $result[$w['id']]['extension_data'] = [
+ [
+ 'name' => '感恩节9折',
+ 'price' => 23,
+ 'type' => 0,
+ 'tips' => '-¥23元',
+ 'business' => null,
+ 'ext' => null,
+ ],
+ ];
$result[$w['id']]['goods_items'] = [];
unset($result[$w['id']]['is_default'], $result[$w['id']]['level'], $result[$w['id']]['inventory']);
@@ -159,6 +178,7 @@ class OrderSplitService
// 仓库
$warehouse_handle = WarehouseService::DataHandle([$warehouse_default]);
$result[$warehouse_default['id']] = $warehouse_handle[0];
+ $result[$warehouse_default['id']]['extension_data'] = [];
$result[$warehouse_default['id']]['goods_items'] = [];
// 订单基础信息
diff --git a/public/static/index/default/css/buy.css b/public/static/index/default/css/buy.css
index c5cc1ed8b..092f320ad 100755
--- a/public/static/index/default/css/buy.css
+++ b/public/static/index/default/css/buy.css
@@ -60,10 +60,9 @@ ul.address-list, .business-item ul { overflow: hidden; }
.nav-buy .btn-go.am-disabled { background-color: #efa4af; }
/* 扩展数据 */
-.buy-extension-data { background: #ffffeb; border: 1px solid #ffe2cf; margin-top: 10px; padding: 5px 10px; margin: 10px 5px 0 5px; }
+.buy-extension-data { background: #ffffeb; border: 1px solid #ffe2cf; }
.buy-extension-data li { padding: 5px 0; }
.buy-extension-data li:not(:last-child) { border-bottom: 1px dashed #ffe2cf; }
-.buy-extension-data .extension-items-name { }
.buy-extension-data .extension-items-tips { color: #ff8f44; }
/**
@@ -138,9 +137,6 @@ ul.address-list, .business-item ul { overflow: hidden; }
.business-item ul li:nth-child(4n) { margin-right: 10px; }
.business-item ul { padding: 10px 1px 0 1px; }
.link-list h3 { padding: 0 0 5px 0; }
-
- /*扩展数据*/
- .buy-extension-data { margin: 10px 0 0 0; }
}
@media only screen and (max-width:640px) {