mirror of
https://github.com/go-home-admin/toolset.git
synced 2026-04-23 00:27:03 +08:00
install 直接返回error
This commit is contained in:
@@ -89,8 +89,8 @@ func (orm *OrmMysqlTableName) Exec(sql string, values ...interface{}) *gorm.DB {
|
||||
|
||||
// ------------ 以下是单表独有的函数, 便捷字段条件, Laravel风格操作 ---------
|
||||
|
||||
func (orm *OrmMysqlTableName) Insert(row *MysqlTableName) *gorm.DB {
|
||||
return orm.db.Create(row)
|
||||
func (orm *OrmMysqlTableName) Insert(row *MysqlTableName) error {
|
||||
return orm.db.Create(row).Error
|
||||
}
|
||||
|
||||
func (orm *OrmMysqlTableName) Inserts(rows []*MysqlTableName) *gorm.DB {
|
||||
|
||||
@@ -89,8 +89,8 @@ func (orm *Orm{orm_table_name}) Exec(sql string, values ...interface{}) *gorm.DB
|
||||
|
||||
// ------------ 以下是单表独有的函数, 便捷字段条件, Laravel风格操作 ---------
|
||||
|
||||
func (orm *Orm{orm_table_name}) Insert(row *{orm_table_name}) *gorm.DB {
|
||||
return orm.db.Create(row)
|
||||
func (orm *Orm{orm_table_name}) Insert(row *{orm_table_name}) error {
|
||||
return orm.db.Create(row).Error
|
||||
}
|
||||
|
||||
func (orm *Orm{orm_table_name}) Inserts(rows []*{orm_table_name}) *gorm.DB {
|
||||
|
||||
Reference in New Issue
Block a user