iferr:=model.DB().Model(CpLevel{}).Where("expire_at < ? AND (points > 0 or level > 0) ",time.Now()).Find(&cpLevels).Error;err!=nil{
iferr:=model.DB().Table("cp_level l").Joins("cp_relation r ON l.cp_id = r.id").Where("l.expire_at < ? AND (l.points > 0 or l.level > 0) ",time.Now()).Find(&cpLevels).Error;err!=nil{