gormt icon indicating copy to clipboard operation
gormt copied to clipboard

int类型为什么转成bool值了

Open tinnkai opened this issue 2 years ago • 1 comments

生成出的结构体 Type bool gorm:"column:type;type:tinyint(1);not null;default:0" // 0增加,1减少

以下是表结构 CREATE TABLE account_log ( id int(11) unsigned NOT NULL AUTO_INCREMENT, admin_id int(11) unsigned NOT NULL COMMENT '管理员ID', user_id int(11) unsigned NOT NULL COMMENT '用户id', type tinyint(1) NOT NULL DEFAULT '0' COMMENT '0增加,1减少', event tinyint(3) NOT NULL COMMENT '操作类型,意义请看accountLog类', time datetime NOT NULL COMMENT '发生时间', note text COMMENT '备注', PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账户余额日志表';

tinnkai avatar Nov 16 '22 10:11 tinnkai

image

xxjwxc avatar Nov 16 '22 11:11 xxjwxc