优化复购功能:指定商品复购付款时直接立减(不返现),解耦分销买家佣金,纯后端实现
这个提交包含在:
@@ -32,7 +32,7 @@ class Activity extends Model
|
||||
|
||||
public static function getTypeList()
|
||||
{
|
||||
return ['seckill' => '秒杀', 'timer' => '限时秒杀', 'robbuy' => '预约抢购', 'groupon' => '拼团', 'full_reduce' => '满额立减', 'full_discount' => '满额折扣', 'free_shipping' => '满额包邮'];
|
||||
return ['seckill' => '秒杀', 'timer' => '限时秒杀', 'robbuy' => '预约抢购', 'groupon' => '拼团', 'full_reduce' => '满额立减', 'full_discount' => '满额折扣', 'free_shipping' => '满额包邮', 'repurchase' => '复购立减'];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,9 +49,11 @@ class Activity extends Model
|
||||
$tag .= $activity_type == 'full_reduce' ? '减' . $ruleData['discount'] : $ruleData['discount'] . '折';
|
||||
} else if ($activity_type == 'free_shipping') {
|
||||
$tag = '满' . $ruleData['full_num'] . ($ruleData['type'] == 'money' ? '元' : '件') . '包邮';
|
||||
} else if ($activity_type == 'repurchase') {
|
||||
$tag = '老客复购立减' . ($ruleData['discount'] ?? '') . '元';
|
||||
}
|
||||
|
||||
return $tag;
|
||||
return $tag ?? '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,10 +55,11 @@ class Order extends Model
|
||||
if ($ext && isset($ext['activity_discount_infos']) && $ext['activity_discount_infos']) {
|
||||
|
||||
foreach ($ext['activity_discount_infos'] as $key => $info) {
|
||||
$ext['activity_discount_infos'][$key]['activity_type_text'] = Activity::getTypeList()[$info['activity_type']];
|
||||
$typeList = Activity::getTypeList();
|
||||
$ext['activity_discount_infos'][$key]['activity_type_text'] = $typeList[$info['activity_type']] ?? ($info['activity_title'] ?? '优惠');
|
||||
$ext['activity_discount_infos'][$key]['format_text'] = Activity::formatDiscountTags($info['activity_type'], array_merge([
|
||||
'type' => $info['rule_type'],
|
||||
], $info['discount_rule']));
|
||||
'type' => $info['rule_type'] ?? 'money',
|
||||
], $info['discount_rule'] ?? []));
|
||||
}
|
||||
}
|
||||
return $ext;
|
||||
|
||||
在新工单中引用
屏蔽一个用户