diff --git a/rule/user_upgrade.go b/rule/user_upgrade.go index 58a1b00..a5f1731 100644 --- a/rule/user_upgrade.go +++ b/rule/user_upgrade.go @@ -144,7 +144,7 @@ func ExtendUserCountWithLv(eg *xorm.Engine, uid, lv int) int64 { func ExtendUserCountWithDay(eg *xorm.Engine, uid, day, activityDay int) int64 { var user []model.User today := utils.GetTimeRange("today") - times := today["start"] - int64(day*86400) + times := today["end"] - int64(day*86400) eg.Where("parent_uid=? and create_at>=?", uid, times).Find(&user) var num int64 = 0 if len(user) > 0 { @@ -171,7 +171,7 @@ func ExtendUserCountWithDay(eg *xorm.Engine, uid, day, activityDay int) int64 { // 直推人数 func ExtendUserCountActivity(eg *xorm.Engine, uid, day, activityNum, finishCount int) int64 { today := utils.GetTimeRange("today") - times := today["start"] - int64(day*86400) + times := today["end"] - int64(day*86400) sql := `SELECT COUNT(*) as count,u.id FROM user u LEFT JOIN egg_sign_in esi on esi.uid=u.id WHERE esi.start_time>='%s' and u.parent_uid=%d GROUP BY u.id HAVING count>=%d LIMIT %d`