aa
This commit is contained in:
@@ -2011,13 +2011,17 @@ func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resource
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
userBind.UnionID = sid
|
userBind.UnionID = sid
|
||||||
//dao.CreateEntity(db, userBind)
|
dao.CreateEntity(db, userBind)
|
||||||
}
|
}
|
||||||
//2、分享链接
|
//2、分享链接
|
||||||
if handler != nil {
|
if handler != nil {
|
||||||
|
var bindImg *model.UserUnionBindImg
|
||||||
if isImg {
|
if isImg {
|
||||||
if userBind.UnionImg != "" {
|
bindImg, _ = dao.GetUserUnionBindImg(db, userBind.UnionID, job.UnionActID)
|
||||||
return userBind.UnionImg, err
|
if bindImg != nil {
|
||||||
|
if bindImg.UnionImg != "" {
|
||||||
|
return bindImg.UnionImg, err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if link, err = handler.ShareUnionLink(ctx, linkType, utils.Str2Int(job.UnionActID), sid, userID, resourceType, goodsID); err == nil {
|
if link, err = handler.ShareUnionLink(ctx, linkType, utils.Str2Int(job.UnionActID), sid, userID, resourceType, goodsID); err == nil {
|
||||||
@@ -2029,11 +2033,16 @@ func ShareUnionLink(ctx *jxcontext.Context, jobID, shareType, linkType, resource
|
|||||||
link += "?imageslim"
|
link += "?imageslim"
|
||||||
//id为0表示要新增
|
//id为0表示要新增
|
||||||
if userBind.ID == 0 {
|
if userBind.ID == 0 {
|
||||||
userBind.UnionImg = link
|
bindImgAdd := &model.UserUnionBindImg{
|
||||||
dao.CreateEntity(db, userBind)
|
UnionID: sid,
|
||||||
|
ActID: job.UnionActID,
|
||||||
|
UnionImg: link,
|
||||||
|
}
|
||||||
|
dao.WrapAddIDCULDEntity(bindImgAdd, ctx.GetUserName())
|
||||||
|
dao.CreateEntity(db, bindImgAdd)
|
||||||
} else {
|
} else {
|
||||||
userBind.UnionImg = link
|
bindImg.UnionImg = link
|
||||||
dao.UpdateEntity(db, userBind, "UnionImg")
|
dao.UpdateEntity(db, bindImg, "UnionImg")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -416,3 +416,22 @@ func GetUserUnionBind(db *DaoDB, userID string, vendorID int, unionID string) (u
|
|||||||
err = GetRows(db, &userBinds, sql, sqlParams)
|
err = GetRows(db, &userBinds, sql, sqlParams)
|
||||||
return userBinds, err
|
return userBinds, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetUserUnionBindImg(db *DaoDB, unionID, actID string) (userBinds *model.UserUnionBindImg, err error) {
|
||||||
|
sql := `
|
||||||
|
SELECT * FROM user_union_bind_img WHERE deleted_at = ?
|
||||||
|
`
|
||||||
|
sqlParams := []interface{}{
|
||||||
|
utils.DefaultTimeValue,
|
||||||
|
}
|
||||||
|
if unionID != "" {
|
||||||
|
sql += " AND union_id = ?"
|
||||||
|
sqlParams = append(sqlParams, unionID)
|
||||||
|
}
|
||||||
|
if actID != "" {
|
||||||
|
sql += " AND act_id = ?"
|
||||||
|
sqlParams = append(sqlParams, actID)
|
||||||
|
}
|
||||||
|
err = GetRow(db, &userBinds, sql, sqlParams)
|
||||||
|
return userBinds, err
|
||||||
|
}
|
||||||
|
|||||||
@@ -295,6 +295,7 @@ type UserUnionBindImg struct {
|
|||||||
ModelIDCULD
|
ModelIDCULD
|
||||||
|
|
||||||
UnionID string `orm:"column(union_id)" json:"unionID"` //推广位ID,美团为userID,淘宝暂时是固定的京西推广位ID,pdd为此推广位ID
|
UnionID string `orm:"column(union_id)" json:"unionID"` //推广位ID,美团为userID,淘宝暂时是固定的京西推广位ID,pdd为此推广位ID
|
||||||
|
ActID string `orm:"column(act_id)" json:"actID"` //对应的活动ID
|
||||||
UnionImg string `json:"unionImg"` //该用户对应平台的处理后的小程序二维码图,目前就美团用,避免二次上传
|
UnionImg string `json:"unionImg"` //该用户对应平台的处理后的小程序二维码图,目前就美团用,避免二次上传
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user