From 9b11acfb8935420a200b0cffdc8642a54a864d73 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sun, 21 Aug 2022 01:28:06 +0800 Subject: [PATCH 1/3] add reverse:for v1.8.7 test --- db/model/user_lv_buy_list.go | 13 +++++++------ svc/extend_price_reward.go | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/db/model/user_lv_buy_list.go b/db/model/user_lv_buy_list.go index 085d77a..e5963b7 100644 --- a/db/model/user_lv_buy_list.go +++ b/db/model/user_lv_buy_list.go @@ -5,10 +5,11 @@ import ( ) type UserLvBuyList struct { - Id int `json:"id" xorm:"not null pk autoincr INT(11)"` - Lv int `json:"lv" xorm:"default 0 comment('等级id') INT(11)"` - Source string `json:"source" xorm:"comment('来源') VARCHAR(255)"` - Uid int `json:"uid" xorm:"default 0 INT(11)"` - Time time.Time `json:"time" xorm:"comment('创建时间') DATETIME"` - Oid string `json:"oid" xorm:"comment('订单号') VARCHAR(255)"` + Id int `json:"id" xorm:"not null pk autoincr INT(11)"` + Lv int `json:"lv" xorm:"default 0 comment('等级id') INT(11)"` + Source string `json:"source" xorm:"comment('来源') VARCHAR(255)"` + Uid int `json:"uid" xorm:"default 0 INT(11)"` + Time time.Time `json:"time" xorm:"comment('创建时间') DATETIME"` + Oid string `json:"oid" xorm:"comment('订单号') VARCHAR(255)"` + ParentUid int `json:"parent_uid" xorm:"default 0 INT(11)"` } diff --git a/svc/extend_price_reward.go b/svc/extend_price_reward.go index 8dfb0ff..5d8bf3a 100644 --- a/svc/extend_price_reward.go +++ b/svc/extend_price_reward.go @@ -55,7 +55,7 @@ func ExtendPriceReward(eg *xorm.Engine, param map[string]string, cfg *comm_plan. } } //查出当前的数量 - count, _ := eg.Where("source=? and lv=?", param["source"], param["level"]).Count(&model.UserLvBuyList{}) + count, _ := eg.Where("source=? and lv=? and parent_uid=?", param["source"], param["level"], userProfile.ParentUid).Count(&model.UserLvBuyList{}) count++ var isTrue = false //如果等级一致 或是代理费分佣 判断位置 From 3a358a6c3bad4f12205d308b2d0a223bbdd126a7 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 22 Aug 2022 18:00:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?add=20reverse:for=20v1.8.8=20=E5=85=AC?= =?UTF-8?q?=E6=8E=92=E4=BF=AE=E6=94=B9=E5=8A=A0=E5=9B=BA=E5=AE=9A=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/public_platoon_relate_commission.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rule/public_platoon_relate_commission.go b/rule/public_platoon_relate_commission.go index 5cd773f..52a30cc 100644 --- a/rule/public_platoon_relate_commission.go +++ b/rule/public_platoon_relate_commission.go @@ -48,7 +48,7 @@ func AddPublicPlatoonRelateCommission(engine *xorm.Engine, AddPublicPlatoonRelat uniqueIdentifier := strings.Split(userPublicPlatoonRelation.UniqueIdentifier, "-") uniqueIdentifier[1] = param.Uid userPublicPlatoonRelation.UniqueIdentifier = strings.Join(uniqueIdentifier, "-") - updateAffected, err := db.UserPublicPlatoonRelationUpdate(engine.NewSession(), userPublicPlatoonRelation.Id, userPublicPlatoonRelation) + updateAffected, err := db.UserPublicPlatoonRelationUpdate(engine.NewSession(), userPublicPlatoonRelation.Id, userPublicPlatoonRelation, "uid", "unique_identifier") if err != nil { return nil, err } @@ -387,7 +387,7 @@ func DealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (err er _ = session.Rollback() } params.Uid = -1 - updateAffected, err := db.UserPublicPlatoonRelationUpdate(session, params.Id, params) + updateAffected, err := db.UserPublicPlatoonRelationUpdate(session, params.Id, params, "uid") if err != nil { _ = session.Rollback() return From 96d78533bab3bd47fff99341be6d4cafd56931f4 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 22 Aug 2022 18:36:25 +0800 Subject: [PATCH 3/3] =?UTF-8?q?add=20reverse:for=20v1.8.9=20=E5=85=AC?= =?UTF-8?q?=E6=8E=92=E4=BF=AE=E6=94=B9=E7=8A=B6=E6=80=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/public_platoon_relate_commission.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rule/public_platoon_relate_commission.go b/rule/public_platoon_relate_commission.go index 52a30cc..edaaeb0 100644 --- a/rule/public_platoon_relate_commission.go +++ b/rule/public_platoon_relate_commission.go @@ -247,7 +247,7 @@ func UpdateWaitForSettlementDate(engine *xorm.Engine, userIds []string) (err err settleDay = userPublicPlatoonSetting.SettleDay } //Todo:: 将 user_public_platoon_relation 中 wait_for_settlement_date 设置为 30天后 - sql := "update user_public_platoon_amount set wait_for_settlement_date = ? where uid in (" + strings.Join(userIds, ",") + ")" + sql := "update user_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") _, err = engine.Exec(sql, waitForSettlementDate) if err != nil {