Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming 2023-11-24 16:52:00 +08:00
commit 9f4745b740
4 changed files with 13 additions and 13 deletions

View File

@ -75,15 +75,15 @@ func (l *UserInfoSetLogic) UserInfoSet(req *types.UserInfoSetReq, userinfo *auth
BuilderDB := fsUserInfoModel.BuilderDB(l.ctx, nil).Model(&gmodel.FsUserInfo{}) BuilderDB := fsUserInfoModel.BuilderDB(l.ctx, nil).Model(&gmodel.FsUserInfo{})
BuilderDB1 := fsUserInfoModel.BuilderDB(l.ctx, nil).Model(&gmodel.FsUserInfo{}) BuilderDB1 := fsUserInfoModel.BuilderDB(l.ctx, nil).Model(&gmodel.FsUserInfo{})
if req.Module == "merchant_category" { if req.Module == "merchant_category" {
BuilderDB1.Where("module = ?", "profile") BuilderDB1 = BuilderDB1.Where("module = ?", "profile")
} else { } else {
BuilderDB1.Where("module = ?", req.Module) BuilderDB1 = BuilderDB1.Where("module = ?", req.Module)
} }
//.Where("user_id=?", userId).Where("guest_id=?", guestId) //.Where("user_id=?", userId).Where("guest_id=?", guestId)
if userId > 0 { if userId > 0 {
BuilderDB1.Where("user_id=?", userId) BuilderDB1 = BuilderDB1.Where("user_id=?", userId)
} else { } else {
BuilderDB1.Where("guest_id=?", guestId) BuilderDB1 = BuilderDB1.Where("guest_id=?", guestId)
} }
userInfo, err = fsUserInfoModel.FindOne(BuilderDB1, nil) userInfo, err = fsUserInfoModel.FindOne(BuilderDB1, nil)
if err != nil { if err != nil {

View File

@ -96,9 +96,9 @@ func (l *UserLogoDataSetLogic) UserLogoDataSet(req *types.UserLogoDataSetReq, us
"guest_id": materialInfoOld.GuestId, "guest_id": materialInfoOld.GuestId,
"resource_id": materialInfoOld.ResourceId, "resource_id": materialInfoOld.ResourceId,
"resource_url": materialInfoOld.ResourceUrl, "resource_url": materialInfoOld.ResourceUrl,
"metadata": materialInfoOld.Metadata,
"ctime": materialInfoOld.Ctime, "ctime": materialInfoOld.Ctime,
"resource_info": nil, "resource_info": nil,
"metadata": nil,
}) })
} }

View File

@ -187,10 +187,10 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
return err return err
} }
var templateTagSelectedVersion string var userMaterialTemplateTagSelectedVersion string
userMaterialVersionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"] userMaterialVersionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"]
if userMaterialVersionEx { if userMaterialVersionEx {
templateTagSelectedVersion = userMaterialVersionData.(string) userMaterialTemplateTagSelectedVersion = userMaterialVersionData.(string)
} }
userMaterialTemplateIdTagIds := userMaterialTemplateIdTagIdData.([]interface{}) userMaterialTemplateIdTagIds := userMaterialTemplateIdTagIdData.([]interface{})
@ -201,7 +201,7 @@ func (l *UserLogoSetLogic) UserLogoSet(req *types.UserLogoSetReq, userinfo *auth
userMaterialTemplateTagIndex := userMaterialTemplateTag[userMaterialTemplateIdTagId] userMaterialTemplateTagIndex := userMaterialTemplateTag[userMaterialTemplateIdTagId]
templateTagSelected := make(map[string]interface{}, 4) templateTagSelected := make(map[string]interface{}, 4)
templateTagSelected["version"] = templateTagSelectedVersion templateTagSelected["version"] = userMaterialTemplateTagSelectedVersion
templateTagSelected["color"] = userMaterialTemplateTagIndex templateTagSelected["color"] = userMaterialTemplateTagIndex
templateTagSelected["template_tag"] = userMaterialTemplateIdTagId templateTagSelected["template_tag"] = userMaterialTemplateIdTagId
templateTagSelected["selected_index"] = 0 templateTagSelected["selected_index"] = 0

View File

@ -64,9 +64,9 @@ func (l *UserLogoTemplateTagSetLogic) UserLogoTemplateTagSet(req *types.UserLogo
var userInfo = &gmodel.FsUserInfo{} var userInfo = &gmodel.FsUserInfo{}
BuilderDB := tx.Model(&gmodel.FsUserInfo{}).Where("module = ?", module) BuilderDB := tx.Model(&gmodel.FsUserInfo{}).Where("module = ?", module)
if userId > 0 { if userId > 0 {
BuilderDB.Where("user_id=?", userId) BuilderDB = BuilderDB.Where("user_id=?", userId)
} else { } else {
BuilderDB.Where("guest_id=?", guestId) BuilderDB = BuilderDB.Where("guest_id=?", guestId)
} }
userInfoFirstRes := BuilderDB.First(userInfo) userInfoFirstRes := BuilderDB.First(userInfo)
err := userInfoFirstRes.Error err := userInfoFirstRes.Error
@ -112,10 +112,10 @@ func (l *UserLogoTemplateTagSetLogic) UserLogoTemplateTagSet(req *types.UserLogo
return err return err
} }
var templateTagSelectedVersion string var userMaterialTemplateTagSelectedVersion string
userMaterialVersionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"] userMaterialVersionData, userMaterialVersionEx := metadataMapOldUserMaterial["version"]
if userMaterialVersionEx { if userMaterialVersionEx {
templateTagSelectedVersion = userMaterialVersionData.(string) userMaterialTemplateTagSelectedVersion = userMaterialVersionData.(string)
} }
userMaterialTemplateTag := userMaterialTemplateTagData.(map[string]interface{}) userMaterialTemplateTag := userMaterialTemplateTagData.(map[string]interface{})
@ -128,7 +128,7 @@ func (l *UserLogoTemplateTagSetLogic) UserLogoTemplateTagSet(req *types.UserLogo
} }
templateTagSelected := make(map[string]interface{}, 4) templateTagSelected := make(map[string]interface{}, 4)
templateTagSelected["version"] = templateTagSelectedVersion templateTagSelected["version"] = userMaterialTemplateTagSelectedVersion
templateTagSelected["color"] = userMaterialTemplateTagIndex templateTagSelected["color"] = userMaterialTemplateTagIndex
templateTagSelected["template_tag"] = req.TemplateTag templateTagSelected["template_tag"] = req.TemplateTag
templateTagSelected["selected_index"] = req.TemplateTagColorIndex templateTagSelected["selected_index"] = req.TemplateTagColorIndex