From b5574d07ef8822cc72399b12a3e9c82e3563244f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Tue, 28 Jun 2022 23:41:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=B9=E6=B3=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BD=B1=E5=93=8D=E8=A1=8C=E6=95=B0=E7=9A=84=E8=BF=94?= =?UTF-8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base.go b/base.go index 01f08e4..cc1d7fc 100644 --- a/base.go +++ b/base.go @@ -26,9 +26,10 @@ func (b *BaseDao) Create(dbInstance *gorm.DB, table string, data interface{}) er // Author : go_developer@163.com<白茶清欢> // // Date : 8:12 下午 2021/8/8 -func (b *BaseDao) Update(dbInstance *gorm.DB, table string, updateDate interface{}, optionFuncList ...SetOption) error { +func (b *BaseDao) Update(dbInstance *gorm.DB, table string, updateDate interface{}, optionFuncList ...SetOption) (int64, error) { b.setTxCondition(dbInstance, table, optionFuncList...) - return dbInstance.Updates(updateDate).Error + r := dbInstance.Updates(updateDate) + return r.RowsAffected, r.Error } // List 查询数据列表