附近小店
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

55 rindas
1.2 KiB

  1. package hdl
  2. import (
  3. "applet/app/db"
  4. "applet/app/e"
  5. "applet/app/svc"
  6. "fmt"
  7. "github.com/gin-gonic/gin"
  8. )
  9. func City(c *gin.Context) {
  10. var arg = make(map[string]string)
  11. c.ShouldBindJSON(&arg)
  12. sql := `select IF(city.name='省直辖县级行政区划' or city.name='市辖区',province.name,city.name) as newname from city
  13. LEFT JOIN province on province.id=city.province_id
  14. where %s
  15. order by CONVERT(newname USING gbk)`
  16. str := "1=1"
  17. if arg["name"] != "" {
  18. str += " and newname like '%" + arg["name"] + "%'"
  19. }
  20. sql = fmt.Sprintf(sql, str)
  21. nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql)
  22. nodeList := make([]map[string]string, 0)
  23. for _, item := range nativeString {
  24. tmp := map[string]string{
  25. "name": item["newname"],
  26. }
  27. nodeList = append(nodeList, tmp)
  28. }
  29. e.OutSuc(c, nodeList, nil)
  30. return
  31. }
  32. func BankStoreCate(c *gin.Context) {
  33. var res = []map[string]string{
  34. {"name": "全部网点", "value": ""},
  35. {"name": "附近网点", "value": "1"},
  36. {"name": "关注网点", "value": "2"},
  37. }
  38. e.OutSuc(c, res, nil)
  39. return
  40. }
  41. func BankStore(c *gin.Context) {
  42. svc.BankStore(c)
  43. }
  44. func Store(c *gin.Context) {
  45. svc.Store(c)
  46. }
  47. func StoreAddLike(c *gin.Context) {
  48. svc.StoreAddLike(c)
  49. }
  50. func StoreCancelLike(c *gin.Context) {
  51. svc.StoreCancelLike(c)
  52. }