package models

import "hongze/hongze_yb/global"

//根据报告id获取发送记录
func GetVoiceSendThsDetailById(voiceId int, reportType string) (item *ReportSendThsDetail, err error) {
	err = global.DEFAULT_MYSQL.Model(ReportSendThsDetail{}).Where("report_id = ? AND report_type=?", voiceId,reportType).Order("send_id DESC").Scan(&item).Error
	return
}

// GetLatelyReportSendThsDetail 获取发送中/发送成功的 距离现在最近的一条记录
func GetLatelyReportSendThsDetail() (item *ReportSendThsDetail, err error) {
	err = global.DEFAULT_MYSQL.Model(ReportSendThsDetail{}).Where(" status >=0").Order("push_time desc,send_id desc").Scan(&item).Error
	return
}

