-f
This commit is contained in:
@@ -712,6 +712,13 @@ func (s *ComponentReportOrderService) DownloadFile(ctx context.Context, orderID
|
||||
zap.String("product_id", purchaseOrder.ProductID))
|
||||
|
||||
// 创建新的下载记录
|
||||
// 设置原始价格:组合包使用UIComponentPrice,单品使用Price
|
||||
var originalPrice decimal.Decimal
|
||||
if product.IsPackage {
|
||||
originalPrice = product.UIComponentPrice
|
||||
} else {
|
||||
originalPrice = product.Price
|
||||
}
|
||||
newDownload := &productEntities.ComponentReportDownload{
|
||||
UserID: purchaseOrder.UserID,
|
||||
ProductID: purchaseOrder.ProductID,
|
||||
@@ -719,6 +726,7 @@ func (s *ComponentReportOrderService) DownloadFile(ctx context.Context, orderID
|
||||
ProductName: product.Name,
|
||||
OrderID: &purchaseOrder.ID,
|
||||
OrderNumber: &purchaseOrder.OrderNo,
|
||||
OriginalPrice: originalPrice, // 设置原始价格
|
||||
DownloadPrice: purchaseOrder.Amount, // 设置下载价格(从订单获取)
|
||||
ExpiresAt: calculateExpiryTime(),
|
||||
}
|
||||
@@ -847,6 +855,13 @@ func (s *ComponentReportOrderService) createDownloadRecordForPaidOrder(ctx conte
|
||||
}
|
||||
|
||||
// 创建新的下载记录
|
||||
// 设置原始价格:组合包使用UIComponentPrice,单品使用Price
|
||||
var originalPrice decimal.Decimal
|
||||
if product.IsPackage {
|
||||
originalPrice = product.UIComponentPrice
|
||||
} else {
|
||||
originalPrice = product.Price
|
||||
}
|
||||
download := &productEntities.ComponentReportDownload{
|
||||
UserID: purchaseOrder.UserID,
|
||||
ProductID: purchaseOrder.ProductID,
|
||||
@@ -854,6 +869,7 @@ func (s *ComponentReportOrderService) createDownloadRecordForPaidOrder(ctx conte
|
||||
ProductName: product.Name,
|
||||
OrderID: &purchaseOrder.ID,
|
||||
OrderNumber: &purchaseOrder.OrderNo,
|
||||
OriginalPrice: originalPrice, // 设置原始价格
|
||||
DownloadPrice: purchaseOrder.Amount, // 设置下载价格(从订单获取)
|
||||
ExpiresAt: calculateExpiryTime(), // 30天后过期
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user