This commit is contained in:
suyl
2021-04-28 11:12:32 +08:00
parent 9a725ed9c2
commit 0ad4efa6a6
2 changed files with 16 additions and 10 deletions

View File

@@ -1968,11 +1968,12 @@ func GetUnionActList(ctx *jxcontext.Context, vendorID, actType int) (actList []*
func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resourceType int) (link string, err error) { func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resourceType int) (link string, err error) {
var ( var (
job = &model.Job{} job = &model.Job{}
db = dao.GetDB() db = dao.GetDB()
sid string //推广位ID美团为userID淘宝饿了么本地化暂时是固定的京西推广位IDpdd为表中推广位ID sid string //推广位ID美团为userID淘宝饿了么本地化暂时是固定的京西推广位IDpdd为表中推广位ID
userID = ctx.GetUserID() //userID = ctx.GetUserID()
userBinds []*model.UserUnionBind mobile, userID = ctx.GetMobileAndUserID()
userBinds []*model.UserUnionBind
) )
job.ID = jobID job.ID = jobID
if err = dao.GetEntity(db, job); err != nil { if err = dao.GetEntity(db, job); err != nil {
@@ -1994,9 +1995,9 @@ func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resource
} }
dao.WrapAddIDCULDEntity(userBind, ctx.GetUserName()) dao.WrapAddIDCULDEntity(userBind, ctx.GetUserName())
if handler != nil { if handler != nil {
if sid, err = handler.CreateUnionPosition(ctx, userID+utils.Int2Str(jobID)); err == nil { if sid, err = handler.CreateUnionPosition(ctx, mobile+utils.Int2Str(jobID)); err == nil {
if sid == "" { if sid == "" {
sid = userID + utils.Int2Str(jobID) sid = mobile + utils.Int2Str(jobID)
if vendorID == model.VendorIDTB { if vendorID == model.VendorIDTB {
sid = utils.Int2Str(tbunionapi.JxAdzoneID) sid = utils.Int2Str(tbunionapi.JxAdzoneID)
} }

View File

@@ -196,8 +196,8 @@ func UnionOrderCallBack(unionOrder *partner.UnionOrderInfo) (err error) {
if unionOrder.SID == "" { if unionOrder.SID == "" {
return err return err
} }
userID := unionOrder.SID[:32] mobile := unionOrder.SID[:11]
jobID := unionOrder.SID[32:] jobID := unionOrder.SID[11:]
txDB, _ := dao.Begin(db) txDB, _ := dao.Begin(db)
defer func() { defer func() {
if r := recover(); r != nil { if r := recover(); r != nil {
@@ -205,7 +205,12 @@ func UnionOrderCallBack(unionOrder *partner.UnionOrderInfo) (err error) {
panic(r) panic(r)
} }
}() }()
userBill, err := dao.GetUserBill(db, userID, "") user, err := dao.GetUserByID(db, "mobile", mobile)
if err != nil {
dao.Rollback(db, txDB)
return err
}
userBill, err := dao.GetUserBill(db, user.UserID, "")
if userBill == nil { if userBill == nil {
return fmt.Errorf("未查询到该用户的账单!") return fmt.Errorf("未查询到该用户的账单!")
} }