|
@@ -8,6 +8,7 @@ import ( |
|
|
zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils" |
|
|
zhios_order_relate_utils "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils" |
|
|
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/logx" |
|
|
zhios_order_relate_logx "code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git/utils/logx" |
|
|
"errors" |
|
|
"errors" |
|
|
|
|
|
"fmt" |
|
|
"math" |
|
|
"math" |
|
|
"strconv" |
|
|
"strconv" |
|
|
"strings" |
|
|
"strings" |
|
@@ -42,12 +43,13 @@ func AddSmallPublicPlatoonRelateCommission(engine *xorm.Engine, AddSmallPublicPl |
|
|
//判断是否有uid为-2 (代表等待新用户填充) 的记录 |
|
|
//判断是否有uid为-2 (代表等待新用户填充) 的记录 |
|
|
userSmallPublicPlatoonRelation, err := db.UserSmallPublicPlatoonRelationGetOneByPid(engine, param.RecommendUid, map[string]interface{}{ |
|
|
userSmallPublicPlatoonRelation, err := db.UserSmallPublicPlatoonRelationGetOneByPid(engine, param.RecommendUid, map[string]interface{}{ |
|
|
"key": "uid", |
|
|
"key": "uid", |
|
|
"value": -2, |
|
|
|
|
|
|
|
|
"value": -1, |
|
|
}) |
|
|
}) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
if userSmallPublicPlatoonRelation != nil { |
|
|
if userSmallPublicPlatoonRelation != nil { |
|
|
|
|
|
oldUid := userSmallPublicPlatoonRelation.Uid |
|
|
userSmallPublicPlatoonRelation.Uid = zhios_order_relate_utils.StrToInt(param.Uid) |
|
|
userSmallPublicPlatoonRelation.Uid = zhios_order_relate_utils.StrToInt(param.Uid) |
|
|
updateAffected, err := db.UserSmallPublicPlatoonRelationUpdate(engine.NewSession(), userSmallPublicPlatoonRelation.Id, userSmallPublicPlatoonRelation) |
|
|
updateAffected, err := db.UserSmallPublicPlatoonRelationUpdate(engine.NewSession(), userSmallPublicPlatoonRelation.Id, userSmallPublicPlatoonRelation) |
|
|
if err != nil { |
|
|
if err != nil { |
|
@@ -57,6 +59,15 @@ func AddSmallPublicPlatoonRelateCommission(engine *xorm.Engine, AddSmallPublicPl |
|
|
err = errors.New("更新 user_public_platoon_relation 记录失败") |
|
|
err = errors.New("更新 user_public_platoon_relation 记录失败") |
|
|
return nil, err |
|
|
return nil, err |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
for n := 1; n <= 9; n++ { |
|
|
|
|
|
str := "father_uid" + strconv.Itoa(n) |
|
|
|
|
|
sql := fmt.Sprintf("UPDATE `user_small_public_platoon_relation` SET %s=%s where %s=%s", str, strconv.Itoa(oldUid), str, param.Uid) |
|
|
|
|
|
fmt.Println(">>>>>>>sql>>>>>>>", sql) |
|
|
|
|
|
_, err = engine.Exec(sql) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
return nil, err |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
resp[param.Uid] = userSmallPublicPlatoonRelation |
|
|
resp[param.Uid] = userSmallPublicPlatoonRelation |
|
|
} |
|
|
} |
|
|
continue |
|
|
continue |
|
@@ -975,11 +986,24 @@ func SmallDealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (e |
|
|
err = errors.New("未查询到公排关系记录") |
|
|
err = errors.New("未查询到公排关系记录") |
|
|
_ = session.Rollback() |
|
|
_ = session.Rollback() |
|
|
} |
|
|
} |
|
|
|
|
|
oldUid := params.Uid |
|
|
|
|
|
|
|
|
//TODO::判断是否为推荐用户 |
|
|
//TODO::判断是否为推荐用户 |
|
|
if params.RecommendUid == 0 { |
|
|
if params.RecommendUid == 0 { |
|
|
params.Uid = -1 |
|
|
|
|
|
|
|
|
params.Uid = params.Uid - 9999999999 |
|
|
} else { |
|
|
} else { |
|
|
params.Uid = -2 |
|
|
|
|
|
|
|
|
params.Uid = params.Uid - 9999999999 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for n := 1; n <= 9; n++ { |
|
|
|
|
|
str := "father_uid" + strconv.Itoa(n) |
|
|
|
|
|
sql := fmt.Sprintf("UPDATE `user_small_public_platoon_relation` SET %s=%s where %s=%s", str, strconv.Itoa(oldUid), str, strconv.Itoa(params.Uid)) |
|
|
|
|
|
fmt.Println(">>>>>>>sql>>>>>>>", sql) |
|
|
|
|
|
_, err = session.Exec(sql) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
_ = session.Rollback() |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
updateAffected, err := db.UserSmallPublicPlatoonRelationUpdate(session, params.Id, params) |
|
|
updateAffected, err := db.UserSmallPublicPlatoonRelationUpdate(session, params.Id, params) |
|
|