解衝突

This commit is contained in:
daniel.w 2024-10-28 01:57:14 +08:00
commit 96377d8edb
1 changed files with 15 additions and 0 deletions

View File

@ -2,8 +2,23 @@ package orderservicelogic
import ( import (
"github.com/shopspring/decimal" "github.com/shopspring/decimal"
"github.com/zeromicro/go-zero/core/logx"
) )
func decimalPtrFromString(val string) *decimal.Decimal {
if val == "" {
return nil
}
dec, err := decimal.NewFromString(val)
if err != nil {
logx.Errorf("Failed to convert string to decimal: %v", err)
return nil
}
return &dec
}
// getInt64Value 將 *int64 的值返回,如果為 nil 則返回 0 // getInt64Value 將 *int64 的值返回,如果為 nil 則返回 0
func getInt64Value(val *int64) int64 { func getInt64Value(val *int64) int64 {
if val == nil { if val == nil {