|
|
@@ -1,11 +1,36 @@ |
|
|
|
package hdl |
|
|
|
|
|
|
|
import ( |
|
|
|
"applet/app/db" |
|
|
|
"applet/app/e" |
|
|
|
"applet/app/svc" |
|
|
|
"fmt" |
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
) |
|
|
|
|
|
|
|
func City(c *gin.Context) { |
|
|
|
var arg = make(map[string]string) |
|
|
|
c.ShouldBindJSON(&arg) |
|
|
|
sql := `select IF(city.name='省直辖县级行政区划' or city.name='市辖区',province.name,city.name) as newname from city |
|
|
|
LEFT JOIN province on province.id=city.province_id |
|
|
|
where %s |
|
|
|
order by CONVERT(newname USING gbk)` |
|
|
|
str := "1=1" |
|
|
|
if arg["name"] != "" { |
|
|
|
str += " and newname like '%" + arg["name"] + "%'" |
|
|
|
} |
|
|
|
sql = fmt.Sprintf(sql, str) |
|
|
|
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql) |
|
|
|
nodeList := make([]map[string]string, 0) |
|
|
|
for _, item := range nativeString { |
|
|
|
tmp := map[string]string{ |
|
|
|
"name": item["newname"], |
|
|
|
} |
|
|
|
nodeList = append(nodeList, tmp) |
|
|
|
} |
|
|
|
e.OutSuc(c, nodeList, nil) |
|
|
|
return |
|
|
|
} |
|
|
|
func BankStoreCate(c *gin.Context) { |
|
|
|
var res = []map[string]string{ |
|
|
|
{"name": "全部网点", "value": ""}, |
|
|
|