Преглед на файлове

update 一个圈圈

master
DengBiao преди 11 месеца
родител
ревизия
19384ce2e6
променени са 1 файла, в които са добавени 6 реда и са изтрити 4 реда
  1. +6
    -4
      rule/one_circles/one_circles_public_platoon_give_activty_coin.go

+ 6
- 4
rule/one_circles/one_circles_public_platoon_give_activty_coin.go Целия файл

@@ -129,16 +129,18 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid

// CalcUserContinuousDailyActivityDays 计算用户连续活跃天数
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
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 {
fmt.Println("err:::::1111", err)
return
}
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 {
isContinuousDailyActivity = true
}


Зареждане…
Отказ
Запис