解衝突
This commit is contained in:
		
						commit
						96377d8edb
					
				|  | @ -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 { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue