Merge branch 'master' of git.zhangdeman.cn:zhangdeman/mysql

This commit is contained in:
2023-03-19 12:46:27 +08:00
7 changed files with 75 additions and 12 deletions

View File

@ -70,6 +70,15 @@ func (b *BaseDao) Detail(dbInstance *gorm.DB, result interface{}, optionFuncList
return dbInstance.Table(b.TableName).First(result).Error
}
// IsNotFound 增加结果是否为数据不存在的判断
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 15:57 2023/2/23
func (b *BaseDao) IsNotFound(err error) bool {
return err == gorm.ErrRecordNotFound
}
// Count 查询数量
//
// Author : go_developer@163.com<白茶清欢>