Browse Source

修复支付订单bug

kobe6258 4 tháng trước cách đây
mục cha
commit
8a82199f0f

+ 1 - 2
domian/merchant/merchant_product.go

@@ -7,7 +7,6 @@ import (
 	stringUtils "eta/eta_mini_ht_api/common/utils/string"
 	reportDomain "eta/eta_mini_ht_api/domian/report"
 	merchantDao "eta/eta_mini_ht_api/models/merchant"
-	"github.com/shopspring/decimal"
 	"gorm.io/gorm"
 	"strings"
 	"sync/atomic"
@@ -35,7 +34,7 @@ type MerchantProductDTO struct {
 	CoverSrc    int
 	CoverUrl    string
 	Description string
-	Price       decimal.Decimal
+	Price       string
 	ProductTile string
 	RiskLevel   string
 	Type        string

+ 1 - 2
models/merchant/merchant_product.go

@@ -5,7 +5,6 @@ import (
 	stringUtils "eta/eta_mini_ht_api/common/utils/string"
 	"eta/eta_mini_ht_api/models"
 	"fmt"
-	"github.com/shopspring/decimal"
 	"sort"
 	"strings"
 	"sync/atomic"
@@ -36,7 +35,7 @@ type MerchantProduct struct {
 	CoverSrc    int                 `gorm:"column:cover_src;type:int(11);comment:封面图片资源库id"`
 	CoverUrl    string              `gorm:"column:cover_url;type:varchar(255);comment:封面图片url"`
 	Description string              `gorm:"column:description;type:varchar(255);comment:描述"`
-	Price       decimal.Decimal     `gorm:"column:price;type:decimal(10,2);comment:价格"`
+	Price       string              `gorm:"column:price;type:decimal(10,2);comment:价格"`
 	RiskLevel   string              `gorm:"-"`
 	Type        MerchantProductType `gorm:"column:type;type:enum('report','video','audio','package');not null;comment:类型"`
 	IsPermanent bool                `gorm:"column:is_permanent;type:int(1);not null;default:0;comment:是否永久"`

+ 2 - 2
service/report/report_service.go

@@ -341,7 +341,7 @@ func DealReportInfo(report *reportService.ReportDTO, isLogin bool, userId int) (
 				report.IsSubscribe = false
 				report.IsPackage = false
 			} else {
-				report.Price = defaultProductPrice
+				report.Price = packageList[0].Price
 				report.IsFree = false
 				report.IsSubscribe = false
 				report.IsPackage = true
@@ -354,7 +354,7 @@ func DealReportInfo(report *reportService.ReportDTO, isLogin bool, userId int) (
 			report.IsPackage = false
 		}
 	} else {
-		report.Price = product.Price.String()
+		report.Price = product.Price
 		report.IsFree = false
 		report.ProductId = product.Id
 		report.IsPackage = false