ソースを参照

update 一个圈圈

master
DengBiao 10ヶ月前
コミット
5e64acbaaf
2個のファイルの変更37行の追加0行の削除
  1. +4
    -0
      db/model/one_circles_public_platoon_user_relation.go
  2. +33
    -0
      rule/one_circles/one_circles_public_platoon_user_relation_commission.go

+ 4
- 0
db/model/one_circles_public_platoon_user_relation.go ファイルの表示

@@ -13,6 +13,7 @@ type OneCirclesPublicPlatoonUserRelation struct {
FatherUid6 int `json:"father_uid6" xorm:"not null default 0 comment('父级uid_6') INT(11)"`
FatherUid7 int `json:"father_uid7" xorm:"not null default 0 comment('父级uid_7') INT(11)"`
FatherUid8 int `json:"father_uid8" xorm:"not null default 0 comment('父级uid_8') INT(11)"`
FatherUid9 int `json:"father_uid9" xorm:"not null default 0 comment('父级uid_9') INT(11)"`
Pid1 int `json:"pid1" xorm:"not null default 0 comment('父级id_1') INT(11)"`
Pid2 int `json:"pid2" xorm:"not null default 0 comment('父级id_2') INT(11)"`
Pid3 int `json:"pid3" xorm:"not null default 0 comment('父级id_3') INT(11)"`
@@ -21,6 +22,7 @@ type OneCirclesPublicPlatoonUserRelation struct {
Pid6 int `json:"pid6" xorm:"not null default 0 comment('父级id_6') INT(11)"`
Pid7 int `json:"pid7" xorm:"not null default 0 comment('父级id_7') INT(11)"`
Pid8 int `json:"pid8" xorm:"not null default 0 comment('父级id_8') INT(11)"`
Pid9 int `json:"pid9" xorm:"not null default 0 comment('父级id_9') INT(11)"`
Position int `json:"position" xorm:"not null default 1 comment('位置(以自己为创始人)') INT(11)"`
Position1 int `json:"position1" xorm:"not null default 0 comment('位置_1(以pid1为创始人中网的位置)') INT(11)"`
Position2 int `json:"position2" xorm:"not null default 0 comment('位置_2') INT(11)"`
@@ -30,6 +32,7 @@ type OneCirclesPublicPlatoonUserRelation struct {
Position6 int `json:"position6" xorm:"not null default 0 comment('位置_6') INT(11)"`
Position7 int `json:"position7" xorm:"not null default 0 comment('位置_7') INT(11)"`
Position8 int `json:"position8" xorm:"not null default 0 comment('位置_8') INT(11)"`
Position9 int `json:"position9" xorm:"not null default 0 comment('位置_9') INT(11)"`
Level int `json:"level" xorm:"not null default 1 comment('等级(以自己为创始人)') INT(11)"`
Level1 int `json:"level1" xorm:"not null default 0 comment('等级_1(以pid1为创始人中网的等级)') INT(11)"`
Level2 int `json:"level2" xorm:"not null default 0 comment('等级_2') INT(11)"`
@@ -39,6 +42,7 @@ type OneCirclesPublicPlatoonUserRelation struct {
Level6 int `json:"level6" xorm:"not null default 0 comment('等级_6') INT(11)"`
Level7 int `json:"level7" xorm:"not null default 0 comment('等级_7') INT(11)"`
Level8 int `json:"level8" xorm:"not null default 0 comment('等级_8') INT(11)"`
Level9 int `json:"level9" xorm:"default 0 comment('等级_9') INT(11)"`
LevelTotal int `json:"level_total" xorm:"not null default 1 comment('等级(整个系统)') INT(11)"`
JoinAt string `json:"join_at" xorm:"not null default 'CURRENT_TIMESTAMP' comment('加入公排时间') DATETIME"`
HasSonNum int `json:"has_son_num" xorm:"not null default 0 comment('拥有直属下级数量') TINYINT(2)"`


+ 33
- 0
rule/one_circles/one_circles_public_platoon_user_relation_commission.go ファイルの表示

@@ -165,6 +165,9 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
if m.Level8 == 0 {
m.Level8--
}
if m.Level9 == 0 {
m.Level9--
}

standardSmallPublicPlatoonRelation.Level1 = m.Level + 1
standardSmallPublicPlatoonRelation.Level2 = m.Level1 + 1
@@ -199,6 +202,7 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
standardSmallPublicPlatoonRelation.FatherUid6 = oneCirclesPublicPlatoonUserRelations[0].FatherUid6
standardSmallPublicPlatoonRelation.FatherUid7 = oneCirclesPublicPlatoonUserRelations[0].FatherUid7
standardSmallPublicPlatoonRelation.FatherUid8 = oneCirclesPublicPlatoonUserRelations[0].FatherUid8
standardSmallPublicPlatoonRelation.FatherUid9 = oneCirclesPublicPlatoonUserRelations[0].FatherUid9

standardSmallPublicPlatoonRelation.Pid1 = oneCirclesPublicPlatoonUserRelations[0].Pid1
standardSmallPublicPlatoonRelation.Pid2 = oneCirclesPublicPlatoonUserRelations[0].Pid2
@@ -208,6 +212,7 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
standardSmallPublicPlatoonRelation.Pid6 = oneCirclesPublicPlatoonUserRelations[0].Pid6
standardSmallPublicPlatoonRelation.Pid7 = oneCirclesPublicPlatoonUserRelations[0].Pid7
standardSmallPublicPlatoonRelation.Pid8 = oneCirclesPublicPlatoonUserRelations[0].Pid8
standardSmallPublicPlatoonRelation.Pid9 = oneCirclesPublicPlatoonUserRelations[0].Pid9

standardSmallPublicPlatoonRelation.Position1 = oneCirclesPublicPlatoonUserRelations[0].Position1 + 1
if oneCirclesPublicPlatoonUserRelations[0].Position2 != 0 {
@@ -231,6 +236,9 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
if oneCirclesPublicPlatoonUserRelations[0].Position8 != 0 {
standardSmallPublicPlatoonRelation.Position8 = oneCirclesPublicPlatoonUserRelations[0].Position8 + 1
}
if oneCirclesPublicPlatoonUserRelations[0].Position9 != 0 {
standardSmallPublicPlatoonRelation.Position9 = oneCirclesPublicPlatoonUserRelations[0].Position9 + 1
}

standardSmallPublicPlatoonRelation.Level1 = oneCirclesPublicPlatoonUserRelations[0].Level1
standardSmallPublicPlatoonRelation.Level2 = oneCirclesPublicPlatoonUserRelations[0].Level2
@@ -240,6 +248,7 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
standardSmallPublicPlatoonRelation.Level6 = oneCirclesPublicPlatoonUserRelations[0].Level6
standardSmallPublicPlatoonRelation.Level7 = oneCirclesPublicPlatoonUserRelations[0].Level7
standardSmallPublicPlatoonRelation.Level8 = oneCirclesPublicPlatoonUserRelations[0].Level8
standardSmallPublicPlatoonRelation.Level9 = oneCirclesPublicPlatoonUserRelations[0].Level9
standardSmallPublicPlatoonRelation.LevelTotal = oneCirclesPublicPlatoonUserRelations[0].LevelTotal

}
@@ -277,6 +286,7 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
oneCirclesPublicPlatoonUserRelation.FatherUid6 = standardSmallPublicPlatoonRelation.FatherUid6
oneCirclesPublicPlatoonUserRelation.FatherUid7 = standardSmallPublicPlatoonRelation.FatherUid7
oneCirclesPublicPlatoonUserRelation.FatherUid8 = standardSmallPublicPlatoonRelation.FatherUid8
oneCirclesPublicPlatoonUserRelation.FatherUid9 = standardSmallPublicPlatoonRelation.FatherUid9
oneCirclesPublicPlatoonUserRelation.Pid1 = standardSmallPublicPlatoonRelation.Pid1
oneCirclesPublicPlatoonUserRelation.Pid2 = standardSmallPublicPlatoonRelation.Pid2
oneCirclesPublicPlatoonUserRelation.Pid3 = standardSmallPublicPlatoonRelation.Pid3
@@ -285,6 +295,7 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
oneCirclesPublicPlatoonUserRelation.Pid6 = standardSmallPublicPlatoonRelation.Pid6
oneCirclesPublicPlatoonUserRelation.Pid7 = standardSmallPublicPlatoonRelation.Pid7
oneCirclesPublicPlatoonUserRelation.Pid8 = standardSmallPublicPlatoonRelation.Pid8
oneCirclesPublicPlatoonUserRelation.Pid9 = standardSmallPublicPlatoonRelation.Pid9
oneCirclesPublicPlatoonUserRelation.Position = 1
oneCirclesPublicPlatoonUserRelation.Position1 = standardSmallPublicPlatoonRelation.Position1
oneCirclesPublicPlatoonUserRelation.Position2 = standardSmallPublicPlatoonRelation.Position2
@@ -294,6 +305,7 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
oneCirclesPublicPlatoonUserRelation.Position6 = standardSmallPublicPlatoonRelation.Position6
oneCirclesPublicPlatoonUserRelation.Position7 = standardSmallPublicPlatoonRelation.Position7
oneCirclesPublicPlatoonUserRelation.Position8 = standardSmallPublicPlatoonRelation.Position8
oneCirclesPublicPlatoonUserRelation.Position9 = standardSmallPublicPlatoonRelation.Position9
oneCirclesPublicPlatoonUserRelation.Level = 1
oneCirclesPublicPlatoonUserRelation.Level1 = standardSmallPublicPlatoonRelation.Level1
oneCirclesPublicPlatoonUserRelation.Level2 = standardSmallPublicPlatoonRelation.Level2
@@ -303,6 +315,7 @@ func OneCirclesPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, oneCirc
oneCirclesPublicPlatoonUserRelation.Level6 = standardSmallPublicPlatoonRelation.Level6
oneCirclesPublicPlatoonUserRelation.Level7 = standardSmallPublicPlatoonRelation.Level7
oneCirclesPublicPlatoonUserRelation.Level8 = standardSmallPublicPlatoonRelation.Level8
oneCirclesPublicPlatoonUserRelation.Level9 = standardSmallPublicPlatoonRelation.Level9
oneCirclesPublicPlatoonUserRelation.LevelTotal = standardSmallPublicPlatoonRelation.LevelTotal
oneCirclesPublicPlatoonUserRelation.RecommendUid = recommendUid
oneCirclesPublicPlatoonUserRelation.JoinAt = now.Format("2006-01-02 15:04:05")
@@ -419,6 +432,9 @@ func oneCirclesSmallFindSuitablePosition(engine *xorm.Engine, position *int, sev
if list[0].Level8 == 0 {
list[0].Level8--
}
if list[0].Level9 == 0 {
list[0].Level9--
}
standardSmallPublicPlatoonRelation.Level1 = list[0].Level + 1
standardSmallPublicPlatoonRelation.Level2 = list[0].Level1 + 1
standardSmallPublicPlatoonRelation.Level3 = list[0].Level2 + 1
@@ -462,6 +478,9 @@ func oneCirclesSmallFindSuitablePosition(engine *xorm.Engine, position *int, sev
if oneCirclesPublicPlatoonUserRelations[0].Position8 == 0 {
standardSmallPublicPlatoonRelation.Position8 = -1
}
if oneCirclesPublicPlatoonUserRelations[0].Position9 == 0 {
standardSmallPublicPlatoonRelation.Position9 = -1
}

standardSmallPublicPlatoonRelation = md.StandardSmallPublicPlatoonRelation{
FatherUid1: oneCirclesPublicPlatoonUserRelations[0].FatherUid1,
@@ -472,6 +491,7 @@ func oneCirclesSmallFindSuitablePosition(engine *xorm.Engine, position *int, sev
FatherUid6: oneCirclesPublicPlatoonUserRelations[0].FatherUid6,
FatherUid7: oneCirclesPublicPlatoonUserRelations[0].FatherUid7,
FatherUid8: oneCirclesPublicPlatoonUserRelations[0].FatherUid8,
FatherUid9: oneCirclesPublicPlatoonUserRelations[0].FatherUid9,
Pid1: oneCirclesPublicPlatoonUserRelations[0].Pid1,
Pid2: oneCirclesPublicPlatoonUserRelations[0].Pid2,
Pid3: oneCirclesPublicPlatoonUserRelations[0].Pid3,
@@ -480,6 +500,7 @@ func oneCirclesSmallFindSuitablePosition(engine *xorm.Engine, position *int, sev
Pid6: oneCirclesPublicPlatoonUserRelations[0].Pid6,
Pid7: oneCirclesPublicPlatoonUserRelations[0].Pid7,
Pid8: oneCirclesPublicPlatoonUserRelations[0].Pid8,
Pid9: oneCirclesPublicPlatoonUserRelations[0].Pid9,
Position1: oneCirclesPublicPlatoonUserRelations[0].Position1 + 1,
Position2: oneCirclesPublicPlatoonUserRelations[0].Position2 + 1,
Position3: oneCirclesPublicPlatoonUserRelations[0].Position3 + 1,
@@ -488,6 +509,7 @@ func oneCirclesSmallFindSuitablePosition(engine *xorm.Engine, position *int, sev
Position6: oneCirclesPublicPlatoonUserRelations[0].Position6 + 1,
Position7: oneCirclesPublicPlatoonUserRelations[0].Position7 + 1,
Position8: oneCirclesPublicPlatoonUserRelations[0].Position8 + 1,
Position9: oneCirclesPublicPlatoonUserRelations[0].Position9 + 1,
Level1: oneCirclesPublicPlatoonUserRelations[0].Level1,
Level2: oneCirclesPublicPlatoonUserRelations[0].Level2,
Level3: oneCirclesPublicPlatoonUserRelations[0].Level3,
@@ -496,6 +518,7 @@ func oneCirclesSmallFindSuitablePosition(engine *xorm.Engine, position *int, sev
Level6: oneCirclesPublicPlatoonUserRelations[0].Level6,
Level7: oneCirclesPublicPlatoonUserRelations[0].Level7,
Level8: oneCirclesPublicPlatoonUserRelations[0].Level8,
Level9: oneCirclesPublicPlatoonUserRelations[0].Level9,
LevelTotal: oneCirclesPublicPlatoonUserRelations[0].LevelTotal,
}
return standardSmallPublicPlatoonRelation, fatherUid, nil
@@ -584,6 +607,16 @@ func oneCirclesGetPosition(m model.OneCirclesPublicPlatoonUserRelation, times in
fatherUid = m.FatherUid8
fatherUidName = "father_uid8"
}
if times == 9 {
position = m.Position9
positionName = "position9"
pid = m.Pid9
pidName = "pid9"
level = m.Level9
levelName = "level9"
fatherUid = m.FatherUid9
fatherUidName = "father_uid9"
}

return
}


読み込み中…
キャンセル
保存