query.go 677 B

12345678910111213141516
  1. package models
  2. import "hongze/hongze_yb/global"
  3. //根据报告id获取发送记录
  4. func GetVoiceSendThsDetailById(voiceId int, reportType string) (item *ReportSendThsDetail, err error) {
  5. err = global.DEFAULT_MYSQL.Model(ReportSendThsDetail{}).Where("report_id = ? AND report_type=?", voiceId,reportType).Order("send_id DESC").Scan(&item).Error
  6. return
  7. }
  8. // GetLatelyReportSendThsDetail 获取发送中/发送成功的 距离现在最近的一条记录
  9. func GetLatelyReportSendThsDetail() (item *ReportSendThsDetail, err error) {
  10. err = global.DEFAULT_MYSQL.Model(ReportSendThsDetail{}).Where(" status >=0").Order("push_time desc,send_id desc").Scan(&item).Error
  11. return
  12. }