fix:设置logo数据库为用户自己素材
This commit is contained in:
parent
d42437d63b
commit
b11b78deab
|
@ -69,7 +69,18 @@ func (l *UserLogoDataSetLogic) UserLogoDataSet(req *types.UserLogoDataSetReq, us
|
|||
}
|
||||
|
||||
var materialInfoOld gmodel.FsUserMaterial
|
||||
result1 := l.svcCtx.MysqlConn.Model(&gmodel.FsUserMaterial{}).Where("logo_id = ?", req.LogoDataId).Take(&materialInfoOld)
|
||||
var FsUserMaterialModel = l.svcCtx.MysqlConn.Model(&gmodel.FsUserMaterial{})
|
||||
if userinfo.IsGuest() {
|
||||
// 如果是,使用游客ID和游客键名格式
|
||||
guestId = userinfo.GuestId
|
||||
FsUserMaterialModel = FsUserMaterialModel.Where("guest_id = ?", guestId)
|
||||
} else {
|
||||
// 否则,使用用户ID和用户键名格式
|
||||
userId = userinfo.UserId
|
||||
FsUserMaterialModel = FsUserMaterialModel.Where("user_id = ?", userId)
|
||||
}
|
||||
|
||||
result1 := FsUserMaterialModel.Where("logo_id = ?", req.LogoDataId).Take(&materialInfoOld)
|
||||
err = result1.Error
|
||||
if err != nil {
|
||||
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user