判断gorm查询结果数据是否存在
func IsNewHot(hot string) bool {
var Record BaiduHot
//3小时内上过榜的则不算新热点
if global.DB.Where("created_at >= DATE_ADD(NOW(),INTERVAL-3 HOUR) and hot = ?", hot).Related(&Record).RecordNotFound() {
return true
}
return false
}