diff --git a/app/db/db_store.go b/app/db/db_store.go index 2de782d..e748a2c 100644 --- a/app/db/db_store.go +++ b/app/db/db_store.go @@ -22,7 +22,7 @@ func GetStore(eg *xorm.Engine, arg map[string]string) []map[string]string { where += " and store_type=" + arg["store_type"] } if arg["city"] != "" { - where += " and city='" + arg["city"] + "'" + where += " and address like '%" + arg["city"] + "%'" } if arg["name"] != "" { where += " and name like '%" + arg["name"] + "'" diff --git a/app/svc/svc_store.go b/app/svc/svc_store.go index a836f68..aa9a095 100644 --- a/app/svc/svc_store.go +++ b/app/svc/svc_store.go @@ -25,12 +25,14 @@ func BankStore(c *gin.Context) { } storeList := make([]map[string]interface{}, 0) for _, v := range store { + km := v["km"] if utils.StrToFloat64(v["km"]) < 1 { v["km"] = utils.IntToStr(int(utils.StrToFloat64(v["km"])*1000)) + "m" } else { + v["km"] = GetCommissionPrec(c, v["km"], "2", "1") v["km"] += "km" } - if utils.StrToFloat64(v["km"]) <= 0 { + if utils.StrToFloat64(km) <= 0 { v["km"] = "-" } tmp := map[string]interface{}{ @@ -73,6 +75,7 @@ func Store(c *gin.Context) { if utils.StrToFloat64(v["km"]) < 1 { v["km"] = utils.IntToStr(int(utils.StrToFloat64(v["km"])*1000)) + "m" } else { + v["km"] = GetCommissionPrec(c, v["km"], "2", "1") v["km"] += "km" } label := make([]string, 0)