Merge branch 'feat-hjj-BundleOrderInvoice#A225' into dev

This commit is contained in:
jiaji.H 2026-02-03 16:04:32 +08:00
commit 90362ac91e

View File

@ -19,8 +19,11 @@ func CreateInvoice(req *bundle.CreateInvoiceReq) (res *bundle.CreateInvoiceResp,
loc, _ := time.LoadLocation("Asia/Shanghai") loc, _ := time.LoadLocation("Asia/Shanghai")
applyTime, err := time.ParseInLocation("20060102 15:04:05", req.ApplyTime, loc) applyTime, err := time.ParseInLocation("20060102 15:04:05", req.ApplyTime, loc)
if err != nil { if err != nil {
fmt.Println("创建发票信息失败:", err) applyTime, err = time.ParseInLocation(time.DateTime, req.ApplyTime, loc)
return nil, err if err != nil {
fmt.Println("创建发票信息失败:", err)
return nil, err
}
} }
inv := &model.Invoice{ inv := &model.Invoice{
UserId: userId, UserId: userId,
@ -52,9 +55,13 @@ func CreatePaperInvoiceAddress(req *bundle.CreatePaperInvoiceAddressReq) (res *b
return nil, err return nil, err
} }
loc, _ := time.LoadLocation("Asia/Shanghai") loc, _ := time.LoadLocation("Asia/Shanghai")
applyTime, err := time.ParseInLocation(time.DateTime, req.ApplyTime, loc) applyTime, err := time.ParseInLocation("20060102 15:04:05", req.ApplyTime, loc)
if err != nil { if err != nil {
return nil, err applyTime, err = time.ParseInLocation(time.DateTime, req.ApplyTime, loc)
if err != nil {
fmt.Println("创建发票信息失败:", err)
return nil, err
}
} }
pia := &model.PaperInvoiceAddress{ pia := &model.PaperInvoiceAddress{
UserId: userId, UserId: userId,