activity_offline_meeting_detail.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // 报名
  7. type CygxActivityOfflineMeetingDetail struct {
  8. Id int `orm:"column(id);pk"`
  9. UserId int `description:"用户id"`
  10. ActivityId int `description:"活动ID"`
  11. CreateTime time.Time `description:"创建时间"`
  12. Mobile string `description:"手机号"`
  13. Email string `description:"邮箱号"`
  14. CompanyId int `description:"公司ID"`
  15. CompanyName string `description:"公司名称"`
  16. IsMeeting int `description:"是否到会 1.是 ,0否"`
  17. IsAirborne int `description:"是否属于空降 1.是 ,0否"`
  18. SigninTime string `description:"签到时间"`
  19. }
  20. // 预约外呼列表
  21. func GetOfflineMeetingList(condition string) (items []*CygxActivitySignupList, err error) {
  22. o := orm.NewOrmUsingDB("hz_cygx")
  23. sql := `SELECT s.* ,
  24. ( SELECT COUNT( 1 ) FROM cygx_activity_signup AS a WHERE a.activity_id = s.activity_id AND a.user_id = s.user_id AND a.do_fail_type = 0 ) AS channel
  25. FROM cygx_activity_offline_meeting_detail as s
  26. WHERE 1 =1 ` + condition
  27. _, err = o.Raw(sql).QueryRows(&items)
  28. return
  29. }
  30. // 预约外呼列表
  31. func GetOfflineMeetingListByUser(meetingUids string, activityId int) (items []*CygxActivityOfflineMeetingDetail, err error) {
  32. o := orm.NewOrmUsingDB("hz_cygx")
  33. sql := `SELECT s.* FROM cygx_activity_offline_meeting_detail as s WHERE activity_id = ? AND user_id IN (` + meetingUids + `)`
  34. _, err = o.Raw(sql, activityId).QueryRows(&items)
  35. return
  36. }
  37. // 预约外呼列表
  38. func GetOfflineMeetingListByYidong(condition string) (items []*CygxActivitySignupList, err error) {
  39. o := orm.NewOrmUsingDB("hz_cygx")
  40. sql := ` SELECT * FROM cygx_activity_signup as s WHERE 1= 1 AND s.yidong_examine_status != 2 ` + condition
  41. _, err = o.Raw(sql).QueryRows(&items)
  42. return
  43. }
  44. func GetOfflineMeetingDetailListCompanyIdStr(companyIdStr string) (item []*CygxActivityMeetDetailLog, err error) {
  45. o := orm.NewOrmUsingDB("hz_cygx")
  46. sql := `SELECT * FROM cygx_activity_offline_meeting_detail WHERE company_id IN (` + companyIdStr + `)`
  47. _, err = o.Raw(sql).QueryRows(&item)
  48. return
  49. }