查询阅读记录
(uid, bookId int)
| 242 | |
| 243 | //查询阅读记录 |
| 244 | func (this *ReadRecord) List(uid, bookId int) (lists []RecordList, cnt int64, err error) { |
| 245 | if uid*bookId == 0 { |
| 246 | err = errors.New("用户id和书籍id不能为空") |
| 247 | return |
| 248 | } |
| 249 | fields := "r.doc_id,r.create_at,d.document_name title,d.identify" |
| 250 | sql := "select %v from %v r left join md_documents d on r.doc_id=d.document_id where r.book_id=? and r.uid=? order by r.id desc limit 5000" |
| 251 | sql = fmt.Sprintf(sql, fields, tableReadRecord) |
| 252 | cnt, err = orm.NewOrm().Raw(sql, bookId, uid).QueryRows(&lists) |
| 253 | return |
| 254 | } |
| 255 | |
| 256 | //查询阅读进度 |
| 257 | func (this *ReadRecord) Progress(uid, bookId int) (rp ReadProgress, err error) { |
nothing calls this directly
no outgoing calls
no test coverage detected