附近小店
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

2 个月前
1周前
2 个月前
2 个月前
2 个月前
2 个月前
1234567891011121314151617181920212223242526272829303132333435
  1. package svc
  2. import (
  3. "applet/app/db"
  4. "applet/app/e"
  5. "applet/app/utils"
  6. "github.com/gin-gonic/gin"
  7. )
  8. func Cate(c *gin.Context) {
  9. storeId := GetStoreId(c)
  10. if storeId == "" {
  11. storeId = "0"
  12. }
  13. if utils.StrToInt(storeId) > 0 {
  14. storeData := db.GetStoreIdEg(MasterDb(c), storeId)
  15. if storeData.StoreType == 0 {
  16. storeId = "0"
  17. }
  18. }
  19. cate := db.GetCate(MasterDb(c), storeId)
  20. cateList := make([]map[string]string, 0)
  21. if cate != nil {
  22. for _, v := range *cate {
  23. tmp := map[string]string{
  24. "id": utils.IntToStr(v.Id),
  25. "name": v.Title,
  26. }
  27. cateList = append(cateList, tmp)
  28. }
  29. }
  30. e.OutSuc(c, cateList, nil)
  31. return
  32. }