fix: upgrade

master
howell 4 years ago
parent 73656bcfb6
commit 3e7e3d5102

@ -202,10 +202,14 @@ func ConfirmOrderTradeSuc(orderInfo *order.Information, clientIP ...string) erro
if e := tx.First(&s1, "id = ?", orderInfo.SharerID).Error; e != nil {
return e
}
level := 0
if userInfo.LoginApp {
level = 1
}
if s1.Level == 2 && userInfo.ParentID == 0 {
// upgrade 修改了升级逻辑
if e := tx.Model(&userInfo).Updates(user.Information{
Level: 0,
Level: level,
ParentID: s1.ID,
UpgradeTime1: formatime.NewSecondNow(),
RootID: s1.RootID,

@ -47,6 +47,7 @@ type Information struct {
UpgradeTime1 formatime.Second `json:"upgrade_time1"`
UpgradeTime2 formatime.Second `json:"upgrade_time2"`
RootID uint `json:"root_id"`
LoginApp bool `json:"login_app"`
}
const (

Loading…
Cancel
Save