From bae837417d4a28c7d7aee43267d4d58f50bc9eb6 Mon Sep 17 00:00:00 2001 From: JNG <365252428@qq.com> Date: Tue, 9 Jun 2026 15:31:41 +0800 Subject: [PATCH] Update orderRecordsLogic.go --- internal/logic/orderRecordsLogic.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/logic/orderRecordsLogic.go b/internal/logic/orderRecordsLogic.go index a3ce488..26c5f4f 100644 --- a/internal/logic/orderRecordsLogic.go +++ b/internal/logic/orderRecordsLogic.go @@ -3,7 +3,6 @@ package logic import ( "errors" "fmt" - uuid "github.com/satori/go.uuid" "micro-bundle/internal/dao" "micro-bundle/internal/model" "micro-bundle/pb/bundle" @@ -11,6 +10,8 @@ import ( "micro-bundle/pkg/utils" "strconv" + uuid "github.com/satori/go.uuid" + "github.com/jinzhu/copier" ) @@ -84,7 +85,7 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons } orderMode := req.OrderMode if orderMode == 0 { - orderMode = model.OrderModeNormal + return res, errors.New("订单模式错误") } payLaterStatus := req.PayLaterStatus if orderMode == model.OrderModePayLater && payLaterStatus == 0 && req.Status != model.BundleStatusPaid { @@ -93,7 +94,7 @@ func CreateOrderRecord(req *bundle.OrderCreateRecord) (res *bundle.CommonRespons // OrderType 从请求中获取,不写死 orderType := req.OrderType if orderType == 0 { - orderType = model.OrderTypeBundle // 默认套餐订单 + return res, errors.New("订单类型错误") } orderRecord := &model.BundleOrderRecords{ UUID: orderUUID,