diff --git a/model/gmodel/fs_user_info_logic.go b/model/gmodel/fs_user_info_logic.go index 8a446689..23304365 100644 --- a/model/gmodel/fs_user_info_logic.go +++ b/model/gmodel/fs_user_info_logic.go @@ -53,7 +53,7 @@ func (m *FsUserInfoModel) MergeMetadata(userId int64, meta any) error { func (m *FsUserInfoModel) GetDefaultProfile(ctx context.Context, tname string) (map[string]any, error) { var baseinfo map[string]any condUser := "user_id = 0 and guest_id = 0" - rawsql := fmt.Sprintf("select JSON_EXTRACT(metadata,'$.*') as query from %s where %s and module = 'profile' order by ctime DESC limit 1", tname, condUser) + rawsql := fmt.Sprintf("select JSON_EXTRACT(metadata,'$') as query from %s where %s and module = 'profile' order by ctime DESC limit 1", tname, condUser) err := m.db.WithContext(ctx).Raw(rawsql).Take(&baseinfo).Error if err != nil { return nil, err