Commit 69593fe8 authored by 张淼's avatar 张淼

1

parent 6a140a9e
...@@ -68,6 +68,7 @@ exports.getThreadById=function(tid,callback){ ...@@ -68,6 +68,7 @@ exports.getThreadById=function(tid,callback){
console.error(err); console.error(err);
cb(err,null); cb(err,null);
}else{ }else{
// console.log(threads);
cb(null,threads); cb(null,threads);
} }
}); });
...@@ -157,6 +158,7 @@ function populateComment(doc, callback){ ...@@ -157,6 +158,7 @@ function populateComment(doc, callback){
console.error(err); console.error(err);
callback(null, null); callback(null, null);
} else{ } else{
console.log(comment);
if(comment.comments){ if(comment.comments){
populateSubComment(comment,function(err, results){ populateSubComment(comment,function(err, results){
if(err){ if(err){
...@@ -300,7 +302,8 @@ function getAllThreadByFidHelp(conditions,pageNo,pageSize,sort,callback){ ...@@ -300,7 +302,8 @@ function getAllThreadByFidHelp(conditions,pageNo,pageSize,sort,callback){
var asyncTasks = []; var asyncTasks = [];
docs.forEach(function(doc){ docs.forEach(function(doc){
if(doc.type===1){ console.log(doc);
if(doc.type===1 || doc.level!==1){//非照片墙或文章时获取评论
asyncTasks.push(function(callback) { asyncTasks.push(function(callback) {
populateComment(doc, callback); populateComment(doc, callback);
}); });
......
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