惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Palo Alto Networks Blog
Latest news
Latest news
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Privacy International News Feed
C
CERT Recently Published Vulnerability Notes
P
Privacy & Cybersecurity Law Blog
V
Visual Studio Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 司徒正美
A
Arctic Wolf
L
Lohrmann on Cybersecurity
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
Hugging Face - Blog
Hugging Face - Blog
Scott Helme
Scott Helme
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
P
Proofpoint News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
T
The Exploit Database - CXSecurity.com
V
Vulnerabilities – Threatpost
C
Check Point Blog
NISL@THU
NISL@THU
T
Tailwind CSS Blog
T
The Blog of Author Tim Ferriss
K
Kaspersky official blog
T
Threat Research - Cisco Blogs
Engineering at Meta
Engineering at Meta
Cyberwarzone
Cyberwarzone
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
G
GRAHAM CLULEY
S
Schneier on Security
Security Latest
Security Latest
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Jina AI
Jina AI

博客园 - 代码小伙

gin框架使用zap,在日志中加入trace_id gorm使用gen自动生成模型和查询文件 Go使用base64Captcha生成字母验证码 GoFrame框架使用WherePri报错原因 GoFrame框架使用BindHandler设置路由失效的原因 GoFrame框架WebServer默认端口号是什么 GoFrame框架SetFileServerEnabled关闭静态服务不生效 vite修改端口号 用路由方式写一个通用的微信小程序校验文件验证 手机网页通过微信deeplink实现wap支付 position:sticky失效原因分析 mysql把一个表的字段赋值到另一张表 基于jquery的countdown插件实现毫秒倒计时 Vue打包代码如何部署在ThinkPHP项目里 保姆级教程,centos7安装erlang和rabbitmq Element Plus表单resetFields重置表单无效 thinkphp6通过中间件设置跨域 centos7安装jdk vue3中使用swiper6实现轮播
GoFrame框架查询数据表时对字段取别名
代码小伙 · 2025-09-15 · via 博客园 - 代码小伙

两种方式,

  • 基于模型的Fields方法
dao.User.Where("id",1).Fields("name as `nickname`","id as `uid`").All()
  • 基于结构体orm标签的映射关系
type UserData struct {
  Uid int `json:"id" orm:"id"`
  Nickname string `json:"nickname" orm:"name"`
}

var user *entity.User
dao.User.Where("id",1).Scan(&user)