Commit 91d2a66d authored by strong's avatar strong

Merge commit '1301e611' into SANDBOX

parents 6edf6c04 1301e611
......@@ -144,8 +144,10 @@ exports.getAllComment = function(conditions, pageNo, pageSize, callback) {
} else {
var skip = (pageNo - 1) * pageSize;
var limit = count - skip > pageSize ? pageSize : (count - skip);
ForumComment.find(conditions,listCommentFields).populate('from','uid mid nickName icon exp').populate('to','uid mid nickName icon exp').limit(limit).skip(skip).sort('-created').exec(function(err, docs) {
ForumComment.find(conditions,listCommentFields).populate({
path: 'from',
select: 'uid mid nickName icon exp honorTitles'
}).populate('to','uid mid nickName icon exp').limit(limit).skip(skip).sort('-created').exec(function(err, docs) {
if (err) {
console.error(err);
callback(err, null);
......@@ -640,7 +642,7 @@ exports.getAllComment_allstatus = function(conditions, pageNo, pageSize, callbac
var skip = (pageNo - 1) * pageSize;
var limit = count - skip > pageSize ? pageSize : (count - skip);
ForumComment.find(conditions,listCommentFields).populate('from','uid mid nickName icon exp').populate('to','uid mid nickName icon exp').limit(limit).skip(skip).sort('-created').exec(function(err, docs) {
ForumComment.find(conditions,listCommentFields).populate('from','uid mid nickName icon exp honorTitles').populate('to','uid mid nickName icon exp').limit(limit).skip(skip).sort('-created').exec(function(err, docs) {
if (err) {
console.error(err);
callback(err, null);
......
......@@ -286,13 +286,9 @@ exports.getByConditions = function(conditions, callback) {
}
//根据ID获取文章
exports.getThreadById = function(tid, callback) {
ForumThread.findOne({_id: tid}).populate({
path: 'from',
select: 'uid mid nickName icon exp honorTitles',
options: {
populate:"honorTitles" //继续查荣誉
}
select: 'uid mid nickName icon exp honorTitles'
}).populate('info','name icon').populate('share').exec(function(err, doc) {
if (err) {
console.error(err);
......@@ -1380,10 +1376,7 @@ exports.getThreadWithNotPopulateComment = function(conditions, pageNo, pageSize,
}
ForumThread.find(conditions).populate({
path: 'from',
select: 'uid mid nickName icon honorTitles',
options: {
populate:"honorTitles" //继续查荣誉
}
select: 'uid mid nickName icon honorTitles'
}).populate('info','name icon pv_count').limit(limit).skip(skip).sort(sortBy).exec(function(err, docs) {
if (err) {
console.error(err);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment