附近小店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

svc_cate.go 509 B

2 months ago
2 months ago
2 months ago
12345678910111213141516171819202122232425262728
  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 := c.GetHeader("store_id")
  10. if storeId == "" {
  11. storeId = "0"
  12. }
  13. cate := db.GetCate(MasterDb(c), storeId)
  14. cateList := make([]map[string]string, 0)
  15. if cate != nil {
  16. for _, v := range *cate {
  17. tmp := map[string]string{
  18. "id": utils.IntToStr(v.Id),
  19. "name": v.Title,
  20. }
  21. cateList = append(cateList, tmp)
  22. }
  23. }
  24. e.OutSuc(c, cateList, nil)
  25. return
  26. }