|
@@ -174,7 +174,17 @@ func convertProductOrderDetailDTO(order orderDao.ProductOrder) (orderDetailDTO P
|
|
|
orderDetailDTO.StatusCN = transProductOrderStatusMap[orderDao.OrderStatusClosed]
|
|
|
} else {
|
|
|
orderDetailDTO.PaymentTimeRemain = int64(duration.Seconds())
|
|
|
-
|
|
|
+ product, err := productDao.GetMerchantProductById(order.ProductID)
|
|
|
+ if err != nil {
|
|
|
+ logger.Error("获取产品信息失败:%v,productId:%d", err, order.ProductID)
|
|
|
+ }
|
|
|
+ if product.Type != productDao.Package {
|
|
|
+ orderDetailDTO.ValidDuration = "永久有效"
|
|
|
+ } else {
|
|
|
+ beginDate := time.Now()
|
|
|
+ endDate := time.Now().Add(time.Duration(product.ValidDays * 24))
|
|
|
+ orderDetailDTO.ValidDuration = fmt.Sprintf("%s~%s", beginDate.Format(time.DateOnly), endDate.Format(time.DateOnly))
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if order.Status == orderDao.OrderStatusPaid {
|
|
@@ -188,19 +198,6 @@ func convertProductOrderDetailDTO(order orderDao.ProductOrder) (orderDetailDTO P
|
|
|
orderDetailDTO.ValidDuration = fmt.Sprintf("%s~%s", access.BeginDate, access.EndDate)
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- product, err := productDao.GetMerchantProductById(order.ProductID)
|
|
|
- if err != nil {
|
|
|
- logger.Error("获取产品信息失败:%v,productId:%d", err, order.ProductID)
|
|
|
- }
|
|
|
- if product.Type != productDao.Package {
|
|
|
- orderDetailDTO.ValidDuration = "永久有效"
|
|
|
- } else {
|
|
|
- beginDate := time.Now()
|
|
|
- endDate := time.Now().Add(time.Duration(product.ValidDays * 24))
|
|
|
- orderDetailDTO.ValidDuration = fmt.Sprintf("%s~%s", beginDate.Format(time.DateOnly), endDate.Format(time.DateOnly))
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
if order.TradeNO != "" {
|
|
|
orderDetailDTO.PaymentTime = order.PaymentTime.Format(time.DateTime)
|