()
| 73 | } |
| 74 | |
| 75 | func (m *DocumentHistory) InsertOrUpdate() (history *DocumentHistory, err error) { |
| 76 | o := orm.NewOrm() |
| 77 | history = m |
| 78 | if history.HistoryId > 0 { |
| 79 | _, err = o.Update(history) |
| 80 | } else { |
| 81 | _, err = o.Insert(history) |
| 82 | } |
| 83 | return |
| 84 | } |
| 85 | |
| 86 | //分页查询指定文档的历史. |
| 87 | func (m *DocumentHistory) FindToPager(docId, pageIndex, pageSize int) (docs []*DocumentHistorySimpleResult, totalCount int, err error) { |