activity_type.go 982 B

123456789101112131415161718192021222324252627282930313233
  1. package models
  2. import (
  3. "github.com/rdlucklib/rdluck_tools/orm"
  4. )
  5. type ActivityType struct {
  6. ActivityTypeId int `description:"活动类型id"`
  7. ActivityTypeName string `description:"活动名称"`
  8. //TemplateP string `description:"活动模板,带P标签"`
  9. //Template string `description:"活动模板"`
  10. ShowType string `description:"人数限制类型,1不展示限制,2可选限制,3强制限制"`
  11. IsChoose bool `description:"是否选择"`
  12. }
  13. type ActivityTypeListResp struct {
  14. List []*ActivityType
  15. }
  16. //列表
  17. func GetActivityTypeList() (items []*ActivityType, err error) {
  18. o := orm.NewOrm()
  19. sql := `SELECT * FROM cygx_activity_type ORDER BY sort DESC`
  20. _, err = o.Raw(sql).QueryRows(&items)
  21. return
  22. }
  23. func GetActivityTypeDetailById(activityTypeId int) (item *ActivityType, err error) {
  24. o := orm.NewOrm()
  25. sql := `SELECT * FROM cygx_activity_type WHERE activity_type_id = ? `
  26. err = o.Raw(sql, activityTypeId).QueryRow(&item)
  27. return
  28. }