Updata:增加不太类型时间格式兼容
This commit is contained in:
parent
275ee0376f
commit
d9b425bba1
@ -19,8 +19,11 @@ func CreateInvoice(req *bundle.CreateInvoiceReq) (res *bundle.CreateInvoiceResp,
|
||||
loc, _ := time.LoadLocation("Asia/Shanghai")
|
||||
applyTime, err := time.ParseInLocation("20060102 15:04:05", req.ApplyTime, loc)
|
||||
if err != nil {
|
||||
fmt.Println("创建发票信息失败:", err)
|
||||
return nil, err
|
||||
applyTime, err = time.ParseInLocation(time.DateTime, req.ApplyTime, loc)
|
||||
if err != nil {
|
||||
fmt.Println("创建发票信息失败:", err)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
inv := &model.Invoice{
|
||||
UserId: userId,
|
||||
@ -51,9 +54,13 @@ func CreatePaperInvoiceAddress(req *bundle.CreatePaperInvoiceAddressReq) (res *b
|
||||
return nil, err
|
||||
}
|
||||
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 {
|
||||
return nil, err
|
||||
applyTime, err = time.ParseInLocation(time.DateTime, req.ApplyTime, loc)
|
||||
if err != nil {
|
||||
fmt.Println("创建发票信息失败:", err)
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
pia := &model.PaperInvoiceAddress{
|
||||
UserId: userId,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user