附近小店
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.
 
 
 

29 rindas
699 B

  1. package db
  2. import (
  3. "applet/app/db/model"
  4. "applet/app/utils"
  5. "xorm.io/xorm"
  6. )
  7. func GetActivityCate(eg *xorm.Engine, storeId string) *[]model.CommunityTeamActivityCate {
  8. var data []model.CommunityTeamActivityCate
  9. ids := []string{"0"}
  10. if utils.StrToInt(storeId) > 0 {
  11. ids = append(ids, storeId)
  12. }
  13. err := eg.Where("is_show=1").In("store_id", ids).OrderBy("sort desc,id desc").Find(&data)
  14. if err != nil {
  15. return nil
  16. }
  17. return &data
  18. }
  19. func GetActivity(eg *xorm.Engine, cid []int) *[]model.CommunityTeamActivity {
  20. var data []model.CommunityTeamActivity
  21. err := eg.Where("is_show=1").In("cid", cid).OrderBy("sort desc,id desc").Find(&data)
  22. if err != nil {
  23. return nil
  24. }
  25. return &data
  26. }