feat(shopro): 新增复购立减活动类型并优化订单活动信息显示
这个提交包含在:
@@ -43,6 +43,7 @@ class Activity extends Model
|
||||
'full_discount' => '满额折扣',
|
||||
'free_shipping' => '满额包邮',
|
||||
'promote' => '限时促销',
|
||||
'repurchase' => '复购立减',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -122,11 +122,14 @@ class Order extends Model
|
||||
|
||||
if ($ext && isset($ext['activity_discount_infos']) && $ext['activity_discount_infos']) {
|
||||
|
||||
$typeList = Activity::getTypeList();
|
||||
foreach ($ext['activity_discount_infos'] as $key => $info) {
|
||||
$ext['activity_discount_infos'][$key]['activity_type_text'] = Activity::getTypeList()[$info['activity_type']];
|
||||
$ext['activity_discount_infos'][$key]['format_text'] = \addons\shopro\model\Activity::formatDiscountTags($info['activity_type'], array_merge([
|
||||
'type' => $info['rule_type'],
|
||||
], $info['discount_rule']));
|
||||
$activityType = $info['activity_type'] ?? '';
|
||||
$ext['activity_discount_infos'][$key]['activity_type_text'] = $typeList[$activityType] ?? ($info['activity_title'] ?? $activityType);
|
||||
$discountRule = is_array($info['discount_rule'] ?? null) ? $info['discount_rule'] : [];
|
||||
$ext['activity_discount_infos'][$key]['format_text'] = \addons\shopro\model\Activity::formatDiscountTags($activityType, array_merge([
|
||||
'type' => $info['rule_type'] ?? '',
|
||||
], $discountRule));
|
||||
}
|
||||
}
|
||||
return $ext;
|
||||
|
||||
在新工单中引用
屏蔽一个用户