Skip to content

Commit 5f49786

Browse files
committed
Refactor code
1 parent 9f44c61 commit 5f49786

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sql_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ func GetColumnsSelect(modelType reflect.Type) []string {
503503
str2 := strings.Split(str1[i], ":")
504504
for j := 0; j < len(str2); j++ {
505505
if str2[j] == "column" {
506-
columnName := str2[j+1]
506+
columnName := strings.ToLower(str2[j+1])
507507
columnNameKeys = append(columnNameKeys, columnName)
508508
}
509509
}

util.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ func RoundFloat(num float64, slice int) float64 {
468468
}
469469
func Round(num big.Float, scale int) big.Float {
470470
marshal, _ := num.MarshalText()
471+
if strings.IndexRune(string(marshal), '.') == -1 {
472+
return num
473+
}
474+
fmt.Println(marshal)
471475
var dot int
472476
for i, v := range marshal {
473477
if v == 46 {

0 commit comments

Comments
 (0)