From 1203c087d8e007c521ff121aabcd8e2736fa397f Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 26 Sep 2023 18:18:48 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/gmodel/fs_order_logic.go | 4 +-- .../internal/logic/userlogosetlogic.go | 26 +++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/model/gmodel/fs_order_logic.go b/model/gmodel/fs_order_logic.go index b068a734..f2a7439a 100644 --- a/model/gmodel/fs_order_logic.go +++ b/model/gmodel/fs_order_logic.go @@ -95,12 +95,12 @@ type OrderStatus struct { // 订单商品 type OrderProduct struct { - TotalPrice AmountInfo `json:"amount"` // 商品总价 + TotalPrice AmountInfo `json:"total_price"` // 商品总价 ExpectedDeliveryTime *time.Time `json:"expected_delivery_time"` // 预计到货时间 PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量 ProductID int64 `json:"product_id"` // 商品ID ProductName string `json:"product_name"` // 商品名称 - ItemPrice AmountInfo `json:"product_price"` // 商品单价 + ItemPrice AmountInfo `json:"item_price"` // 商品单价 ProductSnapshot interface{} `json:"product_snapshot"` // 商品快照 ShoppingCartSnapshot *FsShoppingCartData `json:"shopping_cart_snapshot"` // 购物车快照 ProductCover string `json:"product_cover"` // 商品封面 diff --git a/server/home-user-auth/internal/logic/userlogosetlogic.go b/server/home-user-auth/internal/logic/userlogosetlogic.go index 36d62183..7fc085f4 100644 --- a/server/home-user-auth/internal/logic/userlogosetlogic.go +++ b/server/home-user-auth/internal/logic/userlogosetlogic.go @@ -45,8 +45,31 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth // 如果是,返回未授权的错误码 return resp.SetStatus(basic.CodeUnAuth) } + var nowTime = time.Now().UTC() if req.LogoSelectedId == 0 { - return resp.SetStatus(basic.CodeLogoSetCategory, "logo logo_selected_id not null") + NewFsUserMaterialModel1 := gmodel.NewFsUserMaterialModel(l.svcCtx.MysqlConn) + NewFsUserMaterialModelRow1 := NewFsUserMaterialModel1.RowSelectBuilder(nil).Where("id = ?", 0) + + defaultMaterialInfo, err := NewFsUserMaterialModel1.FindOne(l.ctx, NewFsUserMaterialModelRow1.Model(&gmodel.FsUserMaterial{})) + if err != nil { + logc.Errorf(l.ctx, "defaultMaterialInfo FindOne err:%+v", err) + return resp.SetStatus(basic.CodeLogoSetCategory, "logo not find") + } + var defaultMaterial = gmodel.FsUserMaterial{ + Module: defaultMaterialInfo.Module, + UserId: &userinfo.UserId, + GuestId: &userinfo.GuestId, + ResourceId: defaultMaterialInfo.ResourceId, + ResourceUrl: defaultMaterialInfo.ResourceUrl, + Ctime: &nowTime, + } + MaterialCreateRes := l.svcCtx.MysqlConn.Create(&defaultMaterial) + err = MaterialCreateRes.Error + if err != nil { + logc.Errorf(l.ctx, "defaultMaterialInfo Create err:%+v", err) + return resp.SetStatus(basic.CodeLogoSetCategory, "logo not find") + } + req.LogoSelectedId = defaultMaterial.Id } if req.SetLogoCategory == 1 && req.CategoryId == 0 { return resp.SetStatus(basic.CodeLogoSetCategory, "logo category_id not null") @@ -73,7 +96,6 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth return resp.SetStatus(basic.CodeLogoSetCategory, "logo not find") } - var nowTime = time.Now().UTC() err = l.svcCtx.MysqlConn.WithContext(l.ctx).Transaction(func(tx *gorm.DB) error { var metadataMapOldUserMaterial map[string]interface{} if userMaterialInfo.Metadata != nil { From 9c08acc97a47a75a4604a2fa45a95e638f815bf5 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 26 Sep 2023 18:20:48 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index 4572f1e7..77fb950c 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -714,16 +714,18 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe } // 是否超时支付 - ctime := *order.Ctime - ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix() - ntimeTimeOut := time.Now().UTC().Unix() - if ctimeTimeOut < ntimeTimeOut { - errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout - err = errors.New("order pay timeout") - logx.Errorf("order detail failed, err: %v", err) - return &DetailRes{ - ErrorCode: errorCode, - }, err + if *order.Status == int64(constants.ORDERSTATUSUNPAIDDEPOSIT) { + ctime := *order.Ctime + ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix() + ntimeTimeOut := time.Now().UTC().Unix() + if ctimeTimeOut < ntimeTimeOut { + errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout + err = errors.New("order pay timeout") + logx.Errorf("order detail failed, err: %v", err) + return &DetailRes{ + ErrorCode: errorCode, + }, err + } } ress, err := d.OrderDetailHandler(ctx, &order, 1) From 01b78a099a7fec7303cd99d3590d6020262b6078 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 26 Sep 2023 18:35:27 +0800 Subject: [PATCH 03/12] fix --- .../logic/getproductsteppricelogic.go | 15 ++++++++--- .../internal/logic/ws_render_image.go | 4 +-- utils/format/number.go | 25 +++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 utils/format/number.go diff --git a/server/product/internal/logic/getproductsteppricelogic.go b/server/product/internal/logic/getproductsteppricelogic.go index e30b39bd..9a96014c 100644 --- a/server/product/internal/logic/getproductsteppricelogic.go +++ b/server/product/internal/logic/getproductsteppricelogic.go @@ -105,11 +105,18 @@ func (l *GetProductStepPriceLogic) GetProductStepPrice(req *types.GetProductStep } } stepRange := make([]interface{}, 0, rangeLen) - for _, rangeInfo := range stepPrice.PriceRange { + for rIndex, rangeInfo := range stepPrice.PriceRange { + //最后一个 + if rIndex+1 == rangeLen { + stepRange = append(stepRange, map[string]interface{}{ + "range_description": fmt.Sprintf(">=%s Units", format.NumToStringWithThousandthPercentile(rangeInfo.StartQuantity)), + "item_price": format.CentitoDollar(rangeInfo.Price, 3), + }) + break + } stepRange = append(stepRange, map[string]interface{}{ - "start_quantity": rangeInfo.StartQuantity, - "end_quantity": rangeInfo.EndQuantity, - "item_price": format.CentitoDollar(rangeInfo.Price, 3), + "range_description": fmt.Sprintf("%s-%s Units", format.NumToStringWithThousandthPercentile(rangeInfo.StartQuantity), format.NumToStringWithThousandthPercentile(rangeInfo.EndQuantity)), + "item_price": format.CentitoDollar(rangeInfo.Price, 3), }) } mapRsp[fmt.Sprintf("_%d", *modelPriceInfo.SizeId)] = map[string]interface{}{ diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index 94475c07..13b27117 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -23,7 +23,7 @@ var ( //每个websocket渲染任务缓冲队列长度默认值 renderChanLen = 500 //每个websocket渲染并发数 - renderChanConcurrency = 1 + renderChanConcurrency = 500 ) // 渲染处理器 @@ -369,7 +369,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, combineImage st } //发送运行阶段消息 w.sendRenderDataToUnityStepResponseMessage(info.RenderId) - logx.Info("发送到unity成功,刀版图:", combineImage , " 请求unity的数据:", string(postDataBytes)) + logx.Info("发送到unity成功,刀版图:", combineImage, " 请求unity的数据:", string(postDataBytes)) return nil } diff --git a/utils/format/number.go b/utils/format/number.go new file mode 100644 index 00000000..8cbca6d3 --- /dev/null +++ b/utils/format/number.go @@ -0,0 +1,25 @@ +package format + +import ( + "fmt" + "strings" +) + +// 数字变成带千分位的字符串 +func NumToStringWithThousandthPercentile(number int64) string { + s := fmt.Sprintf("%d", number) + l := len(s) + if l <= 3 { + return s + } + r := l % 3 //前面第几位开始加入千分位 + b := strings.Builder{} + for i := 0; i < l; i++ { + b.WriteString(string(s[i])) + if i+1 == r && i != l-1 { + b.WriteString(",") + r += 3 + } + } + return b.String() +} From 2d0b23e0630998bb0d85ca7822350d2e7e9de4b7 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 26 Sep 2023 18:38:36 +0800 Subject: [PATCH 04/12] fix --- server/websocket/internal/logic/ws_render_image.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index 13b27117..f5a80572 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -369,7 +369,7 @@ func (w *wsConnectItem) assembleRenderDataToUnity(taskId string, combineImage st } //发送运行阶段消息 w.sendRenderDataToUnityStepResponseMessage(info.RenderId) - logx.Info("发送到unity成功,刀版图:", combineImage, " 请求unity的数据:", string(postDataBytes)) + logx.Info("发送到unity成功,刀版图:", combineImage /*, " 请求unity的数据:", string(postDataBytes)*/) return nil } From d22be1d676baa1052b7c3da096e7f75bb376c7b1 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Tue, 26 Sep 2023 18:46:44 +0800 Subject: [PATCH 05/12] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constants/orders.go | 63 ++++++++++++++++++----------------- service/repositories/order.go | 22 ++++++------ 2 files changed, 44 insertions(+), 41 deletions(-) diff --git a/constants/orders.go b/constants/orders.go index 8556c674..abbc45ec 100644 --- a/constants/orders.go +++ b/constants/orders.go @@ -23,8 +23,8 @@ type ExchangeRateUnit interface{} type PayMethods string const ( - PAYMETHODCARD PayMethods = "CARD" - PayMethodVISA PayMethods = "VISA" + PAY_METHOD_CARD PayMethods = "CARD" + PayMethodVISA PayMethods = "VISA" ) // 支付状态 @@ -56,20 +56,21 @@ const ( type OrderStatusCode int64 const ( - ORDERSTATUSUNPAIDDEPOSIT OrderStatusCode = 0 // 0,未支付定金 - ORDERSTATUSDIRECTMAILORDERED OrderStatusCode = 10100 // 10100,直邮单--已下单 - ORDERSTATUSDIRECTMAILORDEREDMAINING OrderStatusCode = 10100001 // 10100001,直邮单--已下单--尾款 - ORDERSTATUSDIRECTMAILCANCEL OrderStatusCode = 10101 // 10101,直邮单--已取消 - ORDERSTATUSDIRECTMAILSTARTPRODUCTION OrderStatusCode = 10200 // 10200,直邮单--开始生产 - ORDERSTATUSDIRECTMAILCOMPLETEPRODUCTION OrderStatusCode = 10300 // 10300,直邮单--生产完成 - ORDERSTATUSDIRECTMAILSHIPPED OrderStatusCode = 10400 // 10400,直邮单--已发货 - ORDERSTATUSDIRECTMAILARRIVED OrderStatusCode = 10500 // 10500,直邮单--已到达 - ORDERSTATUSCLOUDSTOREORDERED OrderStatusCode = 20100 // 20100,云仓单--已下单 - ORDERSTATUSCLOUDSTOREORDEREDMAINING OrderStatusCode = 20100001 // 20100001,云仓单--已下单-尾款 - ORDERSTATUSCLOUDSTORECANCEL OrderStatusCode = 20101 // 20101,云仓单--已取消 - ORDERSTATUSCLOUDSTORESTARTPRODUCTION OrderStatusCode = 20200 // 20200,云仓单--开始生产 - ORDERSTATUSCLOUDSTOREOMPLETEPRODUCTION OrderStatusCode = 20300 // 20300,云仓单--生产完成 - ORDERSTATUSCLOUDSTOREARRIVEDWAREHOUSE OrderStatusCode = 20400 // 20400,云仓单--直达仓库 + ORDER_STATUS_UNPAIDDEPOSIT OrderStatusCode = 0 // 0,未支付定金 + ORDER_STATUS_DIRECTMAIL_ORDERED OrderStatusCode = 10100 // 10100,直邮单--已下单 + ORDER_STATUS_DIRECTMAIL_ORDEREDMAINING OrderStatusCode = 10100001 // 10100001,直邮单--已下单--尾款 + ORDER_STATUS_DIRECTMAIL_CANCEL OrderStatusCode = 10101 // 10101,直邮单--已取消 + ORDER_STATUS_DIRECTMAIL_STARTPRODUCTION OrderStatusCode = 10200 // 10200,直邮单--开始生产 + ORDER_STATUS_DIRECTMAIL_COMPLETEPRODUCTION OrderStatusCode = 10300 // 10300,直邮单--生产完成 + ORDER_STATUS_DIRECTMAIL_SHIPPED OrderStatusCode = 10400 // 10400,直邮单--已发货 + ORDER_STATUS_DIRECTMAIL_ARRIVED OrderStatusCode = 10500 // 10500,直邮单--已到达 + ORDER_STATUS_CLOUDSTORE_ORDERED OrderStatusCode = 20100 // 20100,云仓单--已下单 + ORDER_STATUS_CLOUDSTORE_ORDEREDMAINING OrderStatusCode = 20100001 // 20100001,云仓单--已下单-尾款 + ORDER_STATUS_CLOUDSTORE_CANCEL OrderStatusCode = 20101 // 20101,云仓单--已取消 + ORDER_STATUS_CLOUDSTORE_STARTPRODUCTION OrderStatusCode = 20200 // 20200,云仓单--开始生产 + ORDER_STATUS_CLOUDSTORE_COMPLETEPRODUCTION OrderStatusCode = 20300 // 20300,云仓单--生产完成 + ORDER_STATUS_CLOUDSTORE_ARRIVEDWAREHOUSE OrderStatusCode = 20400 // 20400,云仓单--直达仓库 + ORDER_STATUS_COMPLETE OrderStatusCode = 30000 // 30000,订单完成 ) // 订单状态名称 @@ -93,27 +94,29 @@ func init() { // 订单状态名称 OrderStatusMessage = make(map[OrderStatusCode]string) - OrderStatusMessage[ORDERSTATUSUNPAIDDEPOSIT] = "未支付定金" + OrderStatusMessage[ORDER_STATUS_UNPAIDDEPOSIT] = "未支付定金" - OrderStatusMessage[ORDERSTATUSDIRECTMAILORDERED] = "直邮单--已下单" - OrderStatusMessage[ORDERSTATUSDIRECTMAILSTARTPRODUCTION] = "直邮单--开始生产" - OrderStatusMessage[ORDERSTATUSDIRECTMAILCOMPLETEPRODUCTION] = "直邮单--生产完成" - OrderStatusMessage[ORDERSTATUSDIRECTMAILSHIPPED] = "直邮单--已发货" - OrderStatusMessage[ORDERSTATUSDIRECTMAILARRIVED] = "直邮单--已到达" + OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ORDERED] = "直邮单--已下单" + OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_STARTPRODUCTION] = "直邮单--开始生产" + OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_COMPLETEPRODUCTION] = "直邮单--生产完成" + OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_SHIPPED] = "直邮单--已发货" + OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ARRIVED] = "直邮单--已到达" - OrderStatusMessage[ORDERSTATUSCLOUDSTOREORDERED] = "云仓单--已下单" - OrderStatusMessage[ORDERSTATUSCLOUDSTORESTARTPRODUCTION] = "云仓单--开始生产" - OrderStatusMessage[ORDERSTATUSCLOUDSTOREOMPLETEPRODUCTION] = "云仓单--生产完成" - OrderStatusMessage[ORDERSTATUSCLOUDSTOREARRIVEDWAREHOUSE] = "云仓单--直达仓库" + OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ORDERED] = "云仓单--已下单" + OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_STARTPRODUCTION] = "云仓单--开始生产" + OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_COMPLETEPRODUCTION] = "云仓单--生产完成" + OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ARRIVEDWAREHOUSE] = "云仓单--直达仓库" + + OrderStatusMessage[ORDER_STATUS_COMPLETE] = "订单完成" // 订单状态--用户可见--直邮 OrderStatusUserDIRECTMAIL = []OrderStatusCode{ - ORDERSTATUSUNPAIDDEPOSIT, - ORDERSTATUSDIRECTMAILORDERED, ORDERSTATUSDIRECTMAILSTARTPRODUCTION, ORDERSTATUSDIRECTMAILCOMPLETEPRODUCTION, ORDERSTATUSDIRECTMAILSHIPPED, ORDERSTATUSDIRECTMAILARRIVED, + ORDER_STATUS_UNPAIDDEPOSIT, ORDER_STATUS_COMPLETE, + ORDER_STATUS_DIRECTMAIL_ORDERED, ORDER_STATUS_DIRECTMAIL_STARTPRODUCTION, ORDER_STATUS_DIRECTMAIL_COMPLETEPRODUCTION, ORDER_STATUS_DIRECTMAIL_SHIPPED, ORDER_STATUS_DIRECTMAIL_ARRIVED, } // 订单状态--用户可见--云仓 OrderStatusUserCLOUDSTORE = []OrderStatusCode{ - ORDERSTATUSUNPAIDDEPOSIT, - ORDERSTATUSCLOUDSTOREORDERED, ORDERSTATUSCLOUDSTORESTARTPRODUCTION, ORDERSTATUSCLOUDSTOREOMPLETEPRODUCTION, ORDERSTATUSCLOUDSTOREARRIVEDWAREHOUSE, + ORDER_STATUS_UNPAIDDEPOSIT, ORDER_STATUS_COMPLETE, + ORDER_STATUS_CLOUDSTORE_ORDERED, ORDER_STATUS_CLOUDSTORE_STARTPRODUCTION, ORDER_STATUS_CLOUDSTORE_COMPLETEPRODUCTION, ORDER_STATUS_CLOUDSTORE_ARRIVEDWAREHOUSE, } } diff --git a/service/repositories/order.go b/service/repositories/order.go index 77fb950c..b709b941 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -253,11 +253,11 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess if payStage == "deposit" { if *orderInfo.DeliveryMethod == constants.DELIVERYMETHODDIRECTMAIL { // 直邮 - statusCode = constants.ORDERSTATUSDIRECTMAILORDERED + statusCode = constants.ORDER_STATUS_DIRECTMAIL_ORDERED } if *orderInfo.DeliveryMethod == constants.DELIVERYMETHODDSCLOUDSTORE { // 云仓 - statusCode = constants.ORDERSTATUSCLOUDSTOREORDERED + statusCode = constants.ORDER_STATUS_CLOUDSTORE_ORDERED } payStageInt = 1 orderPayStatusCode = constants.ORDERPAYSTATUSPAIDDEPOSIT @@ -287,13 +287,13 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess if payStage == "remaining_balance" { if *orderInfo.DeliveryMethod == constants.DELIVERYMETHODDIRECTMAIL { // 直邮 - statusCodePre = constants.ORDERSTATUSDIRECTMAILORDERED - statusCode = constants.ORDERSTATUSDIRECTMAILORDEREDMAINING + statusCodePre = constants.ORDER_STATUS_DIRECTMAIL_ORDERED + statusCode = constants.ORDER_STATUS_DIRECTMAIL_ORDEREDMAINING } if *orderInfo.DeliveryMethod == constants.DELIVERYMETHODDSCLOUDSTORE { // 云仓 - statusCodePre = constants.ORDERSTATUSCLOUDSTOREORDERED - statusCode = constants.ORDERSTATUSCLOUDSTOREORDEREDMAINING + statusCodePre = constants.ORDER_STATUS_CLOUDSTORE_ORDERED + statusCode = constants.ORDER_STATUS_CLOUDSTORE_ORDEREDMAINING } payStageInt = 2 orderPayStatusCode = constants.ORDERPAYSTATUSPAIDDREMAINING @@ -313,7 +313,7 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess } statusLink = ress.OrderDetail.OrderInfo.StatusLink - if ress.OrderDetail.OrderInfo.Status.StatusCode == constants.ORDERSTATUSDIRECTMAILORDERED || ress.OrderDetail.OrderInfo.Status.StatusCode == constants.ORDERSTATUSCLOUDSTOREORDERED { + if ress.OrderDetail.OrderInfo.Status.StatusCode == constants.ORDER_STATUS_DIRECTMAIL_ORDERED || ress.OrderDetail.OrderInfo.Status.StatusCode == constants.ORDER_STATUS_CLOUDSTORE_ORDERED { status = ress.OrderDetail.OrderInfo.Status status.Children = statusChildren } @@ -349,7 +349,7 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess PayTitle: &payTitle, }) var sql string - if *orderInfo.Status == int64(constants.ORDERSTATUSUNPAIDDEPOSIT) { + if *orderInfo.Status == int64(constants.ORDER_STATUS_UNPAIDDEPOSIT) { sql = fmt.Sprintf(", `utime` = '%s', `pay_status` = %d, `status` = %d ", ntime, orderPayStatusCode, statusCode) } else { sql = fmt.Sprintf(", `utime` = '%s', `pay_status` = %d", ntime, orderPayStatusCode) @@ -714,7 +714,7 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe } // 是否超时支付 - if *order.Status == int64(constants.ORDERSTATUSUNPAIDDEPOSIT) { + if *order.Status == int64(constants.ORDER_STATUS_UNPAIDDEPOSIT) { ctime := *order.Ctime ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix() ntimeTimeOut := time.Now().UTC().Unix() @@ -985,8 +985,8 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe var status = gmodel.OrderStatus{ Ctime: &nowTime, Utime: &nowTime, - StatusCode: constants.ORDERSTATUSUNPAIDDEPOSIT, - StatusTitle: constants.OrderStatusMessage[constants.ORDERSTATUSUNPAIDDEPOSIT], + StatusCode: constants.ORDER_STATUS_UNPAIDDEPOSIT, + StatusTitle: constants.OrderStatusMessage[constants.ORDER_STATUS_UNPAIDDEPOSIT], } // 订单状态--链路 var statusLink = order.GenerateOrderStatusLink(in.DeliveryMethod, nowTime, in.ExpectedDeliveryTime) From 032d08935981cb89cead0db22eba9c98bdcc6cff Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 27 Sep 2023 10:09:26 +0800 Subject: [PATCH 06/12] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 56 +++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index b709b941..0c6af039 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -17,7 +17,6 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/stripe/stripe-go/v75" "github.com/zeromicro/go-zero/core/logc" - "github.com/zeromicro/go-zero/core/logx" "gorm.io/gorm" ) @@ -226,12 +225,12 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess result := tx.Where("is_del = ?", 0).Where("order_sn = ?", orderSn).Take(&orderInfo) err = result.Error if err != nil { - logx.Errorf("PaymentSuccessful failed order Take, eventId:%s,err: %v", in.EventId, err) + logc.Errorf(ctx, "PaymentSuccessful failed order Take, eventId:%s,err: %v", in.EventId, err) return err } ress, err := d.OrderDetailHandler(ctx, &orderInfo, 0) if err != nil { - logx.Errorf("PaymentSuccessful failed DetailOrderDetailHandler,eventId:%s, err: %v", in.EventId, err) + logc.Errorf(ctx, "PaymentSuccessful failed DetailOrderDetailHandler,eventId:%s, err: %v", in.EventId, err) return err } var ntime = time.Now().UTC() @@ -370,7 +369,7 @@ func (d *defaultOrder) PaymentSuccessful(ctx context.Context, in *PaymentSuccess if len(uOrderDetail) > 0 { err = fssql.MetadataOrderPATCH(d.MysqlConn, sql, orderSn, gmodel.FsOrder{}, uOrderDetail, "id = ?", orderInfo.Id) if err != nil { - logx.Errorf("PaymentSuccessful failed MetadataOrderPATCH,eventId:%s, err: %v", in.EventId, err) + logc.Errorf(ctx, "PaymentSuccessful failed MetadataOrderPATCH,eventId:%s, err: %v", in.EventId, err) return err } } @@ -399,7 +398,7 @@ func (d *defaultOrder) CreatePrePaymentByBalance(ctx context.Context, in *Create } else { errorCode = *basic.CodeServiceErr } - logx.Errorf("create prePayment balance failed, err: %v", err) + logc.Errorf(ctx, "create prePayment balance failed, err: %v", err) return &CreatePrePaymentByBalanceRes{ ErrorCode: errorCode, }, result.Error @@ -408,7 +407,7 @@ func (d *defaultOrder) CreatePrePaymentByBalance(ctx context.Context, in *Create if *order.PayStatus != int64(constants.ORDERPAYSTATUSPAIDDEPOSIT) { errorCode = *basic.CodeErrOrderCreatePrePaymentNoUnPaid err = errors.New("order balance pay status is not unPaid") - logx.Errorf("create prePayment balance failed, err: %v", err) + logc.Errorf(ctx, "create prePayment balance failed, err: %v", err) return &CreatePrePaymentByBalanceRes{ ErrorCode: errorCode, }, err @@ -416,7 +415,7 @@ func (d *defaultOrder) CreatePrePaymentByBalance(ctx context.Context, in *Create ress, err := d.OrderDetailHandler(ctx, &order, 1) if err != nil { - logx.Errorf("create prePayment balance failed DetailOrderDetailHandler, err: %v", err) + logc.Errorf(ctx, "create prePayment balance failed DetailOrderDetailHandler, err: %v", err) errorCode = *basic.CodeServiceErr return &CreatePrePaymentByBalanceRes{ ErrorCode: errorCode, @@ -444,7 +443,7 @@ func (d *defaultOrder) CreatePrePaymentByBalance(ctx context.Context, in *Create prepaymentRes, err := payDriver.GeneratePrepayment(generatePrepaymentReq) if err != nil { - logx.Errorf("create prePayment balance failed GeneratePrepayment, err: %v", err) + logc.Errorf(ctx, "create prePayment balance failed GeneratePrepayment, err: %v", err) errorCode = *basic.CodeServiceErr return &CreatePrePaymentByBalanceRes{ ErrorCode: errorCode, @@ -485,7 +484,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create } else { errorCode = *basic.CodeServiceErr } - logx.Errorf("create prePayment deposit failed, err: %v", err) + logc.Errorf(ctx, "create prePayment deposit failed, err: %v", err) return &CreatePrePaymentByDepositRes{ ErrorCode: errorCode, }, result.Error @@ -495,7 +494,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create if *order.PayStatus != int64(constants.ORDERPAYSTATUSUNPAIDDEPOSIT) { errorCode = *basic.CodeErrOrderCreatePrePaymentNoUnPaid err = errors.New("order pay status is not unPaidDeposit") - logx.Errorf("create prePayment deposit failed, err: %v", err) + logc.Errorf(ctx, "create prePayment deposit failed, err: %v", err) return &CreatePrePaymentByDepositRes{ ErrorCode: errorCode, }, err @@ -511,7 +510,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create if ctimeTimeOut == ntimeTimeOut { errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout err = errors.New("order pay timeout") - logx.Errorf("create prePayment deposit failed, err: %v", err) + logc.Errorf(ctx, "create prePayment deposit failed, err: %v", err) return &CreatePrePaymentByDepositRes{ ErrorCode: errorCode, }, err @@ -519,7 +518,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create ress, err := d.OrderDetailHandler(ctx, &order, 0) if err != nil { - logx.Errorf("create prePayment deposit failed DetailOrderDetailHandler, err: %v", err) + logc.Errorf(ctx, "create prePayment deposit failed DetailOrderDetailHandler, err: %v", err) errorCode = *basic.CodeServiceErr return &CreatePrePaymentByDepositRes{ ErrorCode: errorCode, @@ -573,7 +572,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create err = fssql.MetadataOrderPATCH(d.MysqlConn, sql, in.OrderSn, gmodel.FsOrder{}, uOrderDetail, "id = ?", order.Id) if err != nil { errorCode = *basic.CodeServiceErr - logx.Errorf("create prePayment deposit failed MetadataOrderPATCH, err: %v", err) + logc.Errorf(ctx, "create prePayment deposit failed MetadataOrderPATCH, err: %v", err) return &CreatePrePaymentByDepositRes{ ErrorCode: errorCode, }, result.Error @@ -606,7 +605,7 @@ func (d *defaultOrder) CreatePrePaymentByDeposit(ctx context.Context, in *Create prepaymentRes, err := payDriver.GeneratePrepayment(generatePrepaymentReq) if err != nil { - logx.Errorf("create prePayment deposit failed GeneratePrepayment, err: %v", err) + logc.Errorf(ctx, "create prePayment deposit failed GeneratePrepayment, err: %v", err) errorCode = *basic.CodeServiceErr return &CreatePrePaymentByDepositRes{ ErrorCode: errorCode, @@ -657,7 +656,7 @@ func (d *defaultOrder) List(ctx context.Context, in *ListReq) (res *ListRes, err var count int64 resultCount := model.Count(&count) if resultCount.Error != nil { - logx.Errorf("order count failed, err: %v", err) + logc.Errorf(ctx, "order count failed, err: %v", err) return nil, resultCount.Error } var orderDetailList []gmodel.OrderDetail @@ -665,7 +664,7 @@ func (d *defaultOrder) List(ctx context.Context, in *ListReq) (res *ListRes, err m := model.Scopes(handlers.Paginate(&in.CurrentPage, &in.PerPage)) result := m.Find(&orderList) if result.Error != nil { - logx.Errorf("order list failed, err: %v", err) + logc.Errorf(ctx, "order list failed, err: %v", err) return nil, result.Error } for _, order := range orderList { @@ -707,7 +706,7 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe } else { errorCode = *basic.CodeServiceErr } - logx.Errorf("order detail failed, err: %v", err) + logc.Errorf(ctx, "order detail failed, err: %v", err) return &DetailRes{ ErrorCode: errorCode, }, result.Error @@ -721,7 +720,7 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe if ctimeTimeOut < ntimeTimeOut { errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout err = errors.New("order pay timeout") - logx.Errorf("order detail failed, err: %v", err) + logc.Errorf(ctx, "order detail failed, err: %v", err) return &DetailRes{ ErrorCode: errorCode, }, err @@ -730,7 +729,7 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe ress, err := d.OrderDetailHandler(ctx, &order, 1) if err != nil { - logx.Errorf("order detail failed, err: %v", err) + logc.Errorf(ctx, "order detail failed, err: %v", err) errorCode = *basic.CodeServiceErr return &DetailRes{ ErrorCode: errorCode, @@ -1006,8 +1005,8 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe PayStatus: payStatus, PayTimeout: 30 * time.Minute, } - // 数据库操作 + // 数据库操作 orderDetailByte, err := json.Marshal(orderDetail) if err != nil { return err @@ -1021,14 +1020,21 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe Ctime: &nowTime, Metadata: &orderDetailByte, } - result := tx.Create(&order) - if result.Error != nil { - return result.Error + // 创建订单 + resultCreate := tx.Create(&order) + if resultCreate.Error != nil { + return resultCreate.Error } + // 删除购物车 + resultDelete := tx.Delete(&gmodel.FsShoppingCart{}, in.CartIds) + if resultDelete.Error != nil { + return resultDelete.Error + } + return nil }) if err != nil { - logx.Errorf("order create order failed, err: %v", err) + logc.Errorf(ctx, "order create order failed, err: %v", err) if errorCode.Code == 0 { errorCode.Code = basic.CodeApiErr.Code @@ -1111,7 +1117,7 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel err = json.Unmarshal(*orderInfo.Metadata, &orderDetail) if err != nil { - logx.Errorf("order detail handler unmarshal metadata failed, err: %v", err) + logc.Errorf(ctx, "order detail handler unmarshal metadata failed, err: %v", err) return nil, err } orderDetailOriginal := orderDetail From 6c5323845710473dd7c3d434c8c0c65e6c72cf24 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 27 Sep 2023 10:12:52 +0800 Subject: [PATCH 07/12] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/gmodel/fs_product_logic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/gmodel/fs_product_logic.go b/model/gmodel/fs_product_logic.go index 314886c0..1e7d87e9 100755 --- a/model/gmodel/fs_product_logic.go +++ b/model/gmodel/fs_product_logic.go @@ -4,7 +4,7 @@ import "context" type RelaFsProduct struct { FsProduct - CoverResource *FsResource `json:"cover_resource" gorm:"foreignkey:cover;references:resource_id"` + CoverResource *FsResource `json:"cover_resource" gorm:"foreignkey:cover;references:resource_url"` } func (m *FsProductModel) TableName() string { From e6bd26a77562f269829ca9e4184573ff14e9c6aa Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 27 Sep 2023 10:16:40 +0800 Subject: [PATCH 08/12] fix --- utils/template_switch_info/template_switch.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utils/template_switch_info/template_switch.go b/utils/template_switch_info/template_switch.go index 3ccf3910..260509e5 100644 --- a/utils/template_switch_info/template_switch.go +++ b/utils/template_switch_info/template_switch.go @@ -6,9 +6,10 @@ import ( ) type GetTemplateSwitchInfoRsp struct { - Id int64 `json:"id"` - Material string `json:"material"` - MaterialData MaterialData `json:"material_data"` + Id int64 `json:"id"` + Material string `json:"material"` + MaterialData MaterialData `json:"material_data"` + CombineIsVisible bool `json:"combine_is_visible"` //合图总开关是否开启 } type MaterialData struct { QRcode QRcode `json:"QRcode"` @@ -68,6 +69,7 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa Material: "/image/logo/aHnT1_rzubdwax_scale.png", }, }, + CombineIsVisible: false, } if templateJsonStr == nil || *templateJsonStr == "" { return returnData @@ -78,7 +80,7 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa return returnData } for _, v := range templateJsonInfo.MaterialList { - if v.Type == "combine" && !v.Visible { + if v.Type == "combine" { return GetTemplateSwitchInfoRsp{ Id: templateId, Material: templateMaterialImg, @@ -87,6 +89,7 @@ func GetTemplateSwitchInfo(templateId int64, templateJsonStr *string, templateMa Material: "/image/logo/aHnT1_rzubdwax_scale.png", }, }, + CombineIsVisible: v.Visible, } } switch v.Tag { From f876971e505f144699a42d2e15f2c1cda2ad4104 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 27 Sep 2023 11:10:31 +0800 Subject: [PATCH 09/12] =?UTF-8?q?fix:=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/repositories/order.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/service/repositories/order.go b/service/repositories/order.go index 0c6af039..b2349f43 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -713,19 +713,19 @@ func (d *defaultOrder) Detail(ctx context.Context, in *DetailReq) (res *DetailRe } // 是否超时支付 - if *order.Status == int64(constants.ORDER_STATUS_UNPAIDDEPOSIT) { - ctime := *order.Ctime - ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix() - ntimeTimeOut := time.Now().UTC().Unix() - if ctimeTimeOut < ntimeTimeOut { - errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout - err = errors.New("order pay timeout") - logc.Errorf(ctx, "order detail failed, err: %v", err) - return &DetailRes{ - ErrorCode: errorCode, - }, err - } - } + // if *order.Status == int64(constants.ORDER_STATUS_UNPAIDDEPOSIT) { + // ctime := *order.Ctime + // ctimeTimeOut := ctime.Add(30 * time.Minute).UTC().Unix() + // ntimeTimeOut := time.Now().UTC().Unix() + // if ctimeTimeOut < ntimeTimeOut { + // errorCode = *basic.CodeErrOrderCreatePrePaymentTimeout + // err = errors.New("order pay timeout") + // logc.Errorf(ctx, "order detail failed, err: %v", err) + // return &DetailRes{ + // ErrorCode: errorCode, + // }, err + // } + // } ress, err := d.OrderDetailHandler(ctx, &order, 1) if err != nil { From ab916ac13d2a5fb0cdb68e39e794bc06c6591ae4 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 27 Sep 2023 11:13:37 +0800 Subject: [PATCH 10/12] fix --- model/gmodel/fs_product_model3d_logic.go | 14 +++++ .../internal/logic/gettagproductlistlogic.go | 59 ++++++++++++------- 2 files changed, 53 insertions(+), 20 deletions(-) diff --git a/model/gmodel/fs_product_model3d_logic.go b/model/gmodel/fs_product_model3d_logic.go index df5f7200..5de5f05a 100755 --- a/model/gmodel/fs_product_model3d_logic.go +++ b/model/gmodel/fs_product_model3d_logic.go @@ -152,3 +152,17 @@ func (d *FsProductModel3dModel) FindOneByProductIdSizeIdTag(ctx context.Context, err = db.Take(&resp).Error return resp, err } + +func (d *FsProductModel3dModel) GetAllByProductIdsTags(ctx context.Context, productIds []int64, tags []int, fields ...string) (resp []FsProductModel3d, err error) { + if len(productIds) == 0 || len(tags) == 0 { + return + } + db := d.db.WithContext(ctx).Model(&FsProductModel3d{}). + Where("`product_id` in (?) and `tag` in (?) and `status` = ?", productIds, tags, 1). + Order("sort DESC") + if len(fields) != 0 { + db = db.Select(fields[0]) + } + err = db.Find(&resp).Error + return resp, err +} diff --git a/server/product/internal/logic/gettagproductlistlogic.go b/server/product/internal/logic/gettagproductlistlogic.go index f0538caf..1cc13901 100644 --- a/server/product/internal/logic/gettagproductlistlogic.go +++ b/server/product/internal/logic/gettagproductlistlogic.go @@ -3,10 +3,11 @@ package logic import ( "encoding/json" "errors" + "fmt" + "fusenapi/constants" "fusenapi/model/gmodel" "fusenapi/utils/auth" "fusenapi/utils/basic" - "fusenapi/utils/format" "fusenapi/utils/image" "fusenapi/utils/s3url_to_s3id" "gorm.io/gorm" @@ -228,32 +229,50 @@ func (l *GetTagProductListLogic) getProductRelationInfo(req getProductRelationIn CoverMetadata: req.MapResourceMetadata[*v.Cover], }) } - //获取产品价格列表 - productPriceList, err := l.svcCtx.AllModels.FsProductPrice.GetSimplePriceListByProductIds(l.ctx, productIds) + //获取产品模型价格列表 + modelList, err := l.svcCtx.AllModels.FsProductModel3d.GetAllByProductIdsTags(l.ctx, productIds, []int{constants.TAG_MODEL, constants.TAG_PARTS}, "id,product_id,price,tag,step_price") if err != nil { logx.Error(err) - return nil, errors.New("failed to get product min price list") + return nil, errors.New("failed to get model list") } - //存储产品最小价格 - for _, v := range productPriceList { - priceStrSlic := strings.Split(v.Price, ",") - priceSlice, err := format.StrSlicToIntSlice(priceStrSlic) - if err != nil { - logx.Error(err) - return nil, errors.New("parse price err") + mapModelMinPrice := make(map[int64]int64) + //每个模型/配件存储最小价格 + for _, modelInfo := range modelList { + switch *modelInfo.Tag { + case constants.TAG_MODEL: //模型 + if modelInfo.StepPrice == nil || len(*modelInfo.StepPrice) == 0 { + return nil, errors.New(fmt.Sprintf("model step price is not set:%d", modelInfo.Id)) + } + var stepPrice gmodel.StepPriceJsonStruct + if err = json.Unmarshal(*modelInfo.StepPrice, &stepPrice); err != nil { + logx.Error(err) + return nil, errors.New(fmt.Sprintf("failed to parse model step price:%d", modelInfo.Id)) + } + lenRange := len(stepPrice.PriceRange) + if lenRange == 0 { + return nil, errors.New(fmt.Sprintf("the count of step price is 0:%d", modelInfo.Id)) + } + mapModelMinPrice[modelInfo.Id] = stepPrice.PriceRange[lenRange-1].Price + case constants.TAG_PARTS: //配件 + mapModelMinPrice[modelInfo.Id] = *modelInfo.Price } - if len(priceSlice) == 0 { + } + //给产品存储最小价格 + for _, v := range modelList { + if *v.Tag != constants.TAG_MODEL { continue } - //正序排序价格(注意排序后的阶梯价格不能用作阶梯数量价格计算) - sort.Ints(priceSlice) - if min, ok := req.MapProductMinPrice[v.ProductId]; ok { - if min > int64(priceSlice[0]) { - req.MapProductMinPrice[v.ProductId] = int64(priceSlice[0]) - } - } else { - req.MapProductMinPrice[v.ProductId] = int64(priceSlice[0]) + itemPrice := mapModelMinPrice[v.Id] + if *v.PartId > 0 { + itemPrice += mapModelMinPrice[*v.PartId] } + if minPrice, ok := req.MapProductMinPrice[*v.ProductId]; ok { + if itemPrice < minPrice { + req.MapProductMinPrice[*v.ProductId] = itemPrice + } + continue + } + req.MapProductMinPrice[*v.ProductId] = itemPrice } //获取模板 productTemplatesV2List, err = l.svcCtx.AllModels.FsProductTemplateV2.FindAllByProductIds(l.ctx, productIds, "sort ASC", "product_id,id,model_id,template_tag") From 36ae64f3e7164c87ead3864f1566a406c75215dc Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 27 Sep 2023 11:21:16 +0800 Subject: [PATCH 11/12] fix --- server/product/internal/logic/gettagproductlistlogic.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/product/internal/logic/gettagproductlistlogic.go b/server/product/internal/logic/gettagproductlistlogic.go index 1cc13901..94fd02e4 100644 --- a/server/product/internal/logic/gettagproductlistlogic.go +++ b/server/product/internal/logic/gettagproductlistlogic.go @@ -264,7 +264,9 @@ func (l *GetTagProductListLogic) getProductRelationInfo(req getProductRelationIn } itemPrice := mapModelMinPrice[v.Id] if *v.PartId > 0 { - itemPrice += mapModelMinPrice[*v.PartId] + if fittingPrice, ok := mapModelMinPrice[*v.PartId]; ok { + itemPrice += fittingPrice + } } if minPrice, ok := req.MapProductMinPrice[*v.ProductId]; ok { if itemPrice < minPrice { From 0967df9113722dd6f9c7d4999c7d698f2aa86158 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 27 Sep 2023 11:23:22 +0800 Subject: [PATCH 12/12] fix --- server/product/internal/logic/gettagproductlistlogic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/product/internal/logic/gettagproductlistlogic.go b/server/product/internal/logic/gettagproductlistlogic.go index 94fd02e4..acd47689 100644 --- a/server/product/internal/logic/gettagproductlistlogic.go +++ b/server/product/internal/logic/gettagproductlistlogic.go @@ -230,7 +230,7 @@ func (l *GetTagProductListLogic) getProductRelationInfo(req getProductRelationIn }) } //获取产品模型价格列表 - modelList, err := l.svcCtx.AllModels.FsProductModel3d.GetAllByProductIdsTags(l.ctx, productIds, []int{constants.TAG_MODEL, constants.TAG_PARTS}, "id,product_id,price,tag,step_price") + modelList, err := l.svcCtx.AllModels.FsProductModel3d.GetAllByProductIdsTags(l.ctx, productIds, []int{constants.TAG_MODEL, constants.TAG_PARTS}, "id,product_id,price,tag,part_id,step_price") if err != nil { logx.Error(err) return nil, errors.New("failed to get model list")