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

29 line
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. }