Commit 3c46a11c authored by hujiebin's avatar hujiebin

fix

parent 2c5e4e50
......@@ -229,14 +229,15 @@ func IncrGroupPowerStarOnMic(model *domain.Model, groupPowerId, userId mysql.ID,
return model.Transaction(func(model *domain.Model) error {
star, err := GetGroupPowerMonthStar(model, groupPowerId, userId, groupPower_e.GroupPowerStarTypeActive)
curTs := joinMicTimestamp
nowTs := time.Now().Unix()
if err != nil && err != gorm.ErrRecordNotFound {
return err
}
if star != nil && joinMicTimestamp == star.LastCalTs {
curTs = star.LastCalTs
}
score := time.Now().Unix() - curTs
return IncrGroupPowerMonthStarScore(model, groupPowerId, userId, groupPower_e.GroupPowerStarTypeActive, mysql.Num(score), curTs)
score := nowTs - curTs
return IncrGroupPowerMonthStarScore(model, groupPowerId, userId, groupPower_e.GroupPowerStarTypeActive, mysql.Num(score), nowTs)
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment