后台流水区分四种装扮消费类型:气泡/昵称色/文字色/头像框
- CurrencySource 新增 MSG_BUBBLE_BUY、MSG_NAME_COLOR_BUY、MSG_TEXT_COLOR_BUY - DecorationService::purchase() 按商品 type 选择对应 source - 后台流水页「来源途径」筛选现在可分别查询四种装扮消费
This commit is contained in:
@@ -74,10 +74,14 @@ class DecorationService
|
||||
$days = max(1, (int) ($item->duration_days ?? 1));
|
||||
$expiresAt = Carbon::now()->addDays($days);
|
||||
|
||||
// 头像框与其他装扮使用不同的流水来源标识
|
||||
$source = $item->type === 'avatar_frame'
|
||||
? CurrencySource::AVATAR_FRAME_BUY
|
||||
: CurrencySource::MSG_DECORATION_BUY;
|
||||
// 按装扮类型使用不同的流水来源标识,便于后台按类型筛选消费记录
|
||||
$source = match ($item->type) {
|
||||
'msg_bubble' => CurrencySource::MSG_BUBBLE_BUY,
|
||||
'msg_name_color' => CurrencySource::MSG_NAME_COLOR_BUY,
|
||||
'msg_text_color' => CurrencySource::MSG_TEXT_COLOR_BUY,
|
||||
'avatar_frame' => CurrencySource::AVATAR_FRAME_BUY,
|
||||
default => CurrencySource::MSG_DECORATION_BUY,
|
||||
};
|
||||
|
||||
// 事务包裹:扣金币、写购买记录、更新激活状态三步原子操作
|
||||
DB::transaction(function () use ($user, $item, $slot, $days, $expiresAt, $source) {
|
||||
|
||||
Reference in New Issue
Block a user