|
|
@@ -738,8 +738,8 @@ func OneCirclesDealCommonWealthPunish(engine *xorm.Engine, uid int, reason strin |
|
|
|
return |
|
|
|
} |
|
|
|
if params == nil { |
|
|
|
err = errors.New("未查询到公排关系记录") |
|
|
|
_ = session.Rollback() |
|
|
|
fmt.Println("未查询到公排关系记录!!!!!!!") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//TODO::判断是否为推荐用户 |
|
|
@@ -835,6 +835,10 @@ func OneCirclesDealUserPublicPlatoonPunish(engine *xorm.Engine, masterId string) |
|
|
|
if oneCirclesPublicPlatoonBasicSetting == nil { |
|
|
|
return errors.New("公排制度未开启") |
|
|
|
} |
|
|
|
mapOneCirclesPublicPlatoonFreePunishWithUser, err := db.FindAllOneCirclesPublicPlatoonFreePunishWithUser(engine) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
if oneCirclesPublicPlatoonBasicSetting.SystemPunishReplace == 1 { |
|
|
|
systemPunishReplaceValue := oneCirclesPublicPlatoonBasicSetting.SystemPunishReplaceValue |
|
|
|
startDate := now.AddDate(0, 0, -systemPunishReplaceValue).Format("2006-01-02") + " 00:00:00" |
|
|
@@ -842,7 +846,7 @@ func OneCirclesDealUserPublicPlatoonPunish(engine *xorm.Engine, masterId string) |
|
|
|
var pageSize = 100 |
|
|
|
for { |
|
|
|
var users []model.User |
|
|
|
err = engine.Limit(pageSize, (page-1)*pageSize).Desc("id").Find(&users) |
|
|
|
err = engine.Limit(pageSize, (page-1)*pageSize).Desc("uid").Find(&users) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
@@ -852,7 +856,7 @@ func OneCirclesDealUserPublicPlatoonPunish(engine *xorm.Engine, masterId string) |
|
|
|
for _, user := range users { |
|
|
|
var list []model.OneCirclesGreenEnergySignIn |
|
|
|
err = engine.Where("start_time >= ?", startDate).And("uid = ?", user.Uid).Find(&list) |
|
|
|
if len(list) <= 0 { |
|
|
|
if len(list) <= 0 && mapOneCirclesPublicPlatoonFreePunishWithUser[user.Uid] == nil { |
|
|
|
//进行处罚 |
|
|
|
err, _ = OneCirclesDealCommonWealthPunish(engine, user.Uid, "公排处罚") |
|
|
|
if err != nil { |
|
|
|