activity_ask_email.go 988 B

12345678910111213141516171819202122232425262728293031323334
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type AskEmailRep struct {
  6. Name string `description:"姓名"`
  7. Email string `description:"邮箱"`
  8. Mobile string `description:"手机号"`
  9. ChartPermissionName string `description:"权限名称"`
  10. AdminId int
  11. }
  12. func GetAskEmail() (item []*AskEmailRep, err error) {
  13. o := orm.NewOrmUsingDB("hz_cygx")
  14. sql := `SELECT * FROM cygx_activity_ask_email`
  15. _, err = o.Raw(sql).QueryRows(&item)
  16. return
  17. }
  18. func GetAskEmailList() (item []*AskEmailRep, err error) {
  19. o := orm.NewOrmUsingDB("hz_cygx")
  20. sql := `SELECT * FROM cygx_activity_ask_email WHERE chart_permission_name != '' ORDER BY sort DESC`
  21. _, err = o.Raw(sql).QueryRows(&item)
  22. return
  23. }
  24. func UpdateAskEmail(item *AskEmailRep) (err error) {
  25. o := orm.NewOrmUsingDB("hz_cygx")
  26. sql := `UPDATE cygx_activity_ask_email SET admin_id=? where mobile=?`
  27. _, err = o.Raw(sql,item.AdminId,item.Mobile).Exec()
  28. return
  29. }