Browse Source

Merge remote-tracking branch 'origin/master'

tags/v1.9.0
DengBiao 2 years ago
parent
commit
dc63a35c1f
3 changed files with 11 additions and 10 deletions
  1. +7
    -6
      db/model/user_lv_buy_list.go
  2. +3
    -3
      rule/public_platoon_relate_commission.go
  3. +1
    -1
      svc/extend_price_reward.go

+ 7
- 6
db/model/user_lv_buy_list.go View File

@@ -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)"`
}

+ 3
- 3
rule/public_platoon_relate_commission.go View File

@@ -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
}
@@ -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 {
@@ -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


+ 1
- 1
svc/extend_price_reward.go View File

@@ -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
//如果等级一致 或是代理费分佣 判断位置


Loading…
Cancel
Save