From ff6bddee545cf2a55a23e0d41728e7ffbaab3bd2 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Sat, 6 Aug 2022 20:56:19 +0800 Subject: [PATCH] add Reverse: for v1.6.3 --- .../small_public_platoon_relate_commission.go | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/rule/small_public_platoon_relate_commission.go b/rule/small_public_platoon_relate_commission.go index c847885..739671c 100644 --- a/rule/small_public_platoon_relate_commission.go +++ b/rule/small_public_platoon_relate_commission.go @@ -316,9 +316,6 @@ func naturalSmallPublicPlatoon(engine *xorm.Engine, uid int, originalPosition *i var uniqueIdentifier = zhios_order_relate_utils.IntToStr(pid) + "-" + zhios_order_relate_utils.IntToStr(uid) + "-" + zhios_order_relate_utils.IntToStr(int(level)) + "-" + zhios_order_relate_utils.IntToStr(position) // 3、插入 user_public_platoon_relation 记录 - if userPublicPlatoonSetting.SettleDay == 0 { - userPublicPlatoonSetting.SettleDay = 30 - } now := time.Now() userPublicPlatoonRelation.Uid = uid userPublicPlatoonRelation.FatherUid = fatherUid @@ -327,7 +324,7 @@ func naturalSmallPublicPlatoon(engine *xorm.Engine, uid int, originalPosition *i userPublicPlatoonRelation.Level = int(level) userPublicPlatoonRelation.Position = position userPublicPlatoonRelation.UniqueIdentifier = uniqueIdentifier - userPublicPlatoonRelation.WaitForSettlementDate = now.AddDate(0, 0, userPublicPlatoonSetting.SettleDay).Format("2006-01-02") + userPublicPlatoonRelation.WaitForSettlementDate = now.AddDate(0, 0, 30).Format("2006-01-02") userPublicPlatoonRelation.JoinAt = now userPublicPlatoonRelation.CreateAt = now userPublicPlatoonRelation.UpdateAt = now @@ -419,23 +416,9 @@ func smallFindWaitForDealUsers(engine *xorm.Engine, page, pageSize int) (err err // SmallUpdateWaitForSettlementDate 改变 `wait_for_settlement_date` 待结算时间 func SmallUpdateWaitForSettlementDate(engine *xorm.Engine, userIds []string) (err error) { - //查找 `user_public_platoon_setting` 基础设置 - userPublicPlatoonSetting, err := db.UserPublicPlatoonSettingGetOneByParams(engine, map[string]interface{}{ - "key": "is_open", - "value": 1, - }) - if err != nil { - return err - } - settleDay := 30 - if userPublicPlatoonSetting != nil && userPublicPlatoonSetting.SettleDay == 0 { - settleDay = 30 - } else { - settleDay = userPublicPlatoonSetting.SettleDay - } //Todo:: 将 user_public_platoon_relation 中 wait_for_settlement_date 设置为 30天后 sql := "update user_small_public_platoon_relation set wait_for_settlement_date = ? where uid in (" + strings.Join(userIds, ",") + ")" - waitForSettlementDate := time.Now().AddDate(0, 0, settleDay).Format("2006-01-02") + waitForSettlementDate := time.Now().AddDate(0, 0, 30).Format("2006-01-02") _, err = engine.Exec(sql, waitForSettlementDate) if err != nil { return