Commit 9172e7e9 authored by 陈志良's avatar 陈志良

1

parent 717640fb
This diff is collapsed.
...@@ -288,4 +288,16 @@ exports.getCommentParent = function(cid,callback){ ...@@ -288,4 +288,16 @@ exports.getCommentParent = function(cid,callback){
ForumComment.findOne({comments:{$in:[cid]}},function(err,doc){ ForumComment.findOne({comments:{$in:[cid]}},function(err,doc){
callback(err,doc); callback(err,doc);
}); });
};
//根据ID获取评论
exports.getPopulateCommentById=function(cid,callback){
ForumComment.findById({_id:cid}).populate({path:'from to', select:'uid nickName icon'}).exec(function(err,c){
if (err) {
console.error(err);
callback(null, null);
} else{
callback(null ,c);
}
});
}; };
\ No newline at end of file
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