Commit bdc779f0 authored by 陈家荣's avatar 陈家荣

修改获取文章

parent 2923211e
......@@ -985,11 +985,15 @@ function countAllByConditionsAndNickName(nickName, conditions, callback) {
var count = 0;
//匹配 nickName
for(var i in results){
if(results[i].from){
if(results[i].from.nickName){
var flag = results[i].from.nickName.toString().indexOf(nickName);
if(flag >= 0){ // 如果有
count+=1;
}
}
}
}
callback(null, count);
}else{
callback(null, 0);
......@@ -1029,11 +1033,15 @@ function getAllThreadByFidHelpAndNickName(nickName, conditions, pageNo, pageSize
//匹配 nickName
var new_threads = [];
for(var i in docs){
if(docs[i].from){
if(docs[i].from.nickName){
var flag = docs[i].from.nickName.toString().indexOf(nickName);
if(flag >= 0){ // 如果有
new_threads.push(docs[i]);
}
}
}
}
var return_threads = new_threads.slice(skip, skip + limit);
......
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