pull/701/head
miaowuawa 1 year ago
parent 6c1aeda1fe
commit 61c9083ceb

@ -36,7 +36,10 @@ type CommentMetric struct {
}
func (m *CommentMetric) RankScore(motivationFactor int) int64 {
return int64(m.IncentiveScore * motivationFactor / m.DecayFactor)
if m.DecayFactor == 0 {
return 0
}
return int64(m.IncentiveScore * motivationFactor / m.DecayFactor)
}
// UserMetric 用户指标结构体

@ -17,6 +17,8 @@ CREATE TABLE p_comment_metric (
"decay_factor" integer NOT NULL DEFAULT 0,
"motivation_factor" integer NOT NULL DEFAULT 0,
"reply_count" integer NOT NULL DEFAULT 0,
"thumbs_up_count" integer NOT NULL DEFAULT 0,
"thumbs_down_count" integer NOT NULL DEFAULT 0,
"is_del" integer NOT NULL DEFAULT 0,
"created_on" integer NOT NULL DEFAULT 0,
"modified_on" integer NOT NULL DEFAULT 0,

Loading…
Cancel
Save