huangjiajun 2 months ago
parent
commit
5d9cab5835
2 changed files with 5 additions and 2 deletions
  1. +1
    -1
      app/db/db_store.go
  2. +4
    -1
      app/svc/svc_store.go

+ 1
- 1
app/db/db_store.go View File

@@ -22,7 +22,7 @@ func GetStore(eg *xorm.Engine, arg map[string]string) []map[string]string {
where += " and store_type=" + arg["store_type"] where += " and store_type=" + arg["store_type"]
} }
if arg["city"] != "" { if arg["city"] != "" {
where += " and city='" + arg["city"] + "'"
where += " and address like '%" + arg["city"] + "%'"
} }
if arg["name"] != "" { if arg["name"] != "" {
where += " and name like '%" + arg["name"] + "'" where += " and name like '%" + arg["name"] + "'"


+ 4
- 1
app/svc/svc_store.go View File

@@ -25,12 +25,14 @@ func BankStore(c *gin.Context) {
} }
storeList := make([]map[string]interface{}, 0) storeList := make([]map[string]interface{}, 0)
for _, v := range store { for _, v := range store {
km := v["km"]
if utils.StrToFloat64(v["km"]) < 1 { if utils.StrToFloat64(v["km"]) < 1 {
v["km"] = utils.IntToStr(int(utils.StrToFloat64(v["km"])*1000)) + "m" v["km"] = utils.IntToStr(int(utils.StrToFloat64(v["km"])*1000)) + "m"
} else { } else {
v["km"] = GetCommissionPrec(c, v["km"], "2", "1")
v["km"] += "km" v["km"] += "km"
} }
if utils.StrToFloat64(v["km"]) <= 0 {
if utils.StrToFloat64(km) <= 0 {
v["km"] = "-" v["km"] = "-"
} }
tmp := map[string]interface{}{ tmp := map[string]interface{}{
@@ -73,6 +75,7 @@ func Store(c *gin.Context) {
if utils.StrToFloat64(v["km"]) < 1 { if utils.StrToFloat64(v["km"]) < 1 {
v["km"] = utils.IntToStr(int(utils.StrToFloat64(v["km"])*1000)) + "m" v["km"] = utils.IntToStr(int(utils.StrToFloat64(v["km"])*1000)) + "m"
} else { } else {
v["km"] = GetCommissionPrec(c, v["km"], "2", "1")
v["km"] += "km" v["km"] += "km"
} }
label := make([]string, 0) label := make([]string, 0)


Loading…
Cancel
Save