|
|
@@ -59,15 +59,15 @@ func (u UserLevelDb) UserLevelAllByAscByPage(page, limit int) ([]*model.UserLeve |
|
|
|
return m, total, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (u UserLevelDb) UserLevelUpdate(id interface{}, userLevel *model.UserLevel, forceColumns ...string) (int64, error) { |
|
|
|
func (u UserLevelDb) UserLevelUpdateBySession(session *xorm.Session, id interface{}, userLevel *model.UserLevel, forceColumns ...string) (int64, error) { |
|
|
|
var ( |
|
|
|
affected int64 |
|
|
|
err error |
|
|
|
) |
|
|
|
if forceColumns != nil { |
|
|
|
affected, err = u.Db.Where("id=?", id).MustCols(forceColumns...).Update(userLevel) |
|
|
|
affected, err = session.Where("id=?", id).MustCols(forceColumns...).Update(userLevel) |
|
|
|
} else { |
|
|
|
affected, err = u.Db.Where("id=?", id).Update(userLevel) |
|
|
|
affected, err = session.Where("id=?", id).Update(userLevel) |
|
|
|
} |
|
|
|
if err != nil { |
|
|
|
return 0, zhios_order_relate_logx.Error(err.Error()) |
|
|
@@ -83,8 +83,8 @@ func (u UserLevelDb) UserLevelDeleteBySession(session *xorm.Session, id interfac |
|
|
|
return affected, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (u UserLevelDb) UserLevelInsert(userLevel *model.UserLevel) (int, error) { |
|
|
|
_, err := u.Db.InsertOne(userLevel) |
|
|
|
func (u UserLevelDb) UserLevelInsertBySession(session *xorm.Session, userLevel *model.UserLevel) (int, error) { |
|
|
|
_, err := session.Insert(userLevel) |
|
|
|
if err != nil { |
|
|
|
return 0, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|