对单表记录进行统计查询 @param table 需要查询或者统计的表 @param cond 查询条件 @return cnt 统计的记录数
(table string, cond *orm.Condition)
| 500 | //@param cond 查询条件 |
| 501 | //@return cnt 统计的记录数 |
| 502 | func Count(table string, cond *orm.Condition) (cnt int64) { |
| 503 | cnt, _ = orm.NewOrm().QueryTable(getTable(table)).SetCond(cond).Count() |
| 504 | return |
| 505 | } |
| 506 | |
| 507 | //是否已收藏文档 |
| 508 | //@param did 文档id,即document id |