V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
fxjson
V2EX  ›  程序员

gorm 关联查询问题咨询?

  •  
  •   fxjson · 2021-01-14 22:24:40 +08:00 · 755 次点击
    这是一个创建于 1196 天前的主题,其中的信息可能已经有所发展或是发生改变。

    type User struct { gorm.Model Name string AccountId uint Account Acount }

    type Account struct{ AccountId gorm:"primary_key" Age int } 获取的数据结构是 { id:1, name:"json", accountid:1, account:{ age:32, accountid:1 } } 怎么在不添加数据结构情况下得到下面的结构,就是将 age 提升到外面一级别 { id:1, name:"json", accountid:1, age:32, }

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3741 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 05:04 · PVG 13:04 · LAX 22:04 · JFK 01:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.