附近小店
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

db_printer_detail.go 660 B

1 个月前
1234567891011121314151617181920212223242526272829
  1. package db
  2. import (
  3. "applet/app/db/model"
  4. "xorm.io/xorm"
  5. )
  6. func DetailInsert(Db *xorm.Engine, data *model.CommunityTeamStorePrinterDetail) (int64, error) {
  7. affected, err := Db.InsertOne(data)
  8. if err != nil {
  9. return 0, err
  10. }
  11. return affected, nil
  12. }
  13. func DetailUpdate(Db *xorm.Engine, id interface{}, data *model.CommunityTeamStorePrinterDetail, forceColums ...string) (int64, error) {
  14. var (
  15. affected int64
  16. err error
  17. )
  18. if forceColums != nil {
  19. affected, err = Db.Where("id=?", id).Cols(forceColums...).Update(data)
  20. } else {
  21. affected, err = Db.Where("id=?", id).Update(data)
  22. }
  23. if err != nil {
  24. return 0, err
  25. }
  26. return affected, nil
  27. }