|
@@ -129,16 +129,18 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid |
|
|
|
|
|
|
|
|
// CalcUserContinuousDailyActivityDays 计算用户连续活跃天数 |
|
|
// CalcUserContinuousDailyActivityDays 计算用户连续活跃天数 |
|
|
func CalcUserContinuousDailyActivityDays(engine *xorm.Engine, masterId string, uid int, startDate string, endDate string) (err error, days int, isContinuousDailyActivity bool) { |
|
|
func CalcUserContinuousDailyActivityDays(engine *xorm.Engine, masterId string, uid int, startDate string, endDate string) (err error, days int, isContinuousDailyActivity bool) { |
|
|
|
|
|
startAt, err := time.ParseInLocation("2006-01-02", startDate, time.Local) //起始时间 |
|
|
|
|
|
endAt, err := time.ParseInLocation("2006-01-02", endDate, time.Local) //起始时间 |
|
|
var list []model.OneCirclesGreenEnergySignIn |
|
|
var list []model.OneCirclesGreenEnergySignIn |
|
|
err = engine.Where("start_time >= ?", startDate).And("uid =?", uid).Find(&list) |
|
|
|
|
|
|
|
|
err = engine.Where("start_time >= ?", startAt.Format("2006-01-02 15:04:05")). |
|
|
|
|
|
And("start_time < ?", endAt.Format("2006-01-02 15:04:05")). |
|
|
|
|
|
And("uid =?", uid).Find(&list) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
fmt.Println("err:::::1111", err) |
|
|
fmt.Println("err:::::1111", err) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
days = len(list) |
|
|
days = len(list) |
|
|
startAt, err := time.ParseInLocation("2006-01-02", startDate, time.Local) //起始时间 |
|
|
|
|
|
endAt, err := time.ParseInLocation("2006-01-02", endDate, time.Local) //起始时间 |
|
|
|
|
|
diffDays := zhios_order_relate_utils.GetDiffDays(endAt, startAt) //相差天数 |
|
|
|
|
|
|
|
|
diffDays := zhios_order_relate_utils.GetDiffDays(endAt, startAt) //相差天数 |
|
|
if days == diffDays { |
|
|
if days == diffDays { |
|
|
isContinuousDailyActivity = true |
|
|
isContinuousDailyActivity = true |
|
|
} |
|
|
} |
|
|