user_remind.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxUserRemind struct {
  7. Id int `orm:"column(id);pk"`
  8. AdminId int
  9. UserId int
  10. CreateTime time.Time
  11. ModifyTime time.Time
  12. Mobile string `description:"手机号"`
  13. Email string `description:"邮箱"`
  14. CompanyId int `description:"公司id"`
  15. CompanyName string `description:"公司名称"`
  16. RealName string `description:"用户实际名称"`
  17. AdminName string `description:"管理员销售姓名"`
  18. }
  19. //添加
  20. func AddCygxUserRemind(item *CygxUserRemind) (lastId int64, err error) {
  21. o := orm.NewOrm()
  22. lastId, err = o.Insert(item)
  23. return
  24. }
  25. type CygxUserRemindResp struct {
  26. Status int `description:"1:添加,2:取消"`
  27. }
  28. func RemoveCygxUserRemind(userId int) (err error) {
  29. o := orm.NewOrm()
  30. sql := `DELETE FROM cygx_user_remind WHERE user_id=? `
  31. _, err = o.Raw(sql, userId).Exec()
  32. return
  33. }
  34. func GetCygxUserRemindCount(userId int) (count int, err error) {
  35. sql := `SELECT COUNT(1) AS count FROM cygx_user_remind WHERE user_id=? `
  36. err = orm.NewOrm().Raw(sql, userId).QueryRow(&count)
  37. return
  38. }