Commit 1d245410 authored by 杨翌文's avatar 杨翌文

1

parent 530e2846
......@@ -722,11 +722,14 @@ function getSubThreads(doc, sort, callback) {
}
function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) {
console.time('count_cost');
countAllByFid(conditions, function(err, count) {
if (err) {
console.error(err);
callback(err, null);
} else {
console.timeEnd('count_cost');
console.time('threads_cost');
var skip = (pageNo - 1) * pageSize;
var limit = pageSize;
var sortBy = '-topTime -tag_topTime -quality -created';
......@@ -748,12 +751,13 @@ function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) {
console.error(err);
callback(err, null);
} else {
console.timeEnd('threads_cost');
var obj = {};
obj.total = count;
obj.pageNo = pageNo;
obj.pageSize = pageSize;
obj.items = docs;
console.time('comments_cost');
if (docs && docs.length > 0) {
var asyncTasks = [];
......@@ -777,6 +781,7 @@ function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) {
} else {
obj.items = results;
callback(null, obj);
console.timeEnd('comments_cost');
}
});
......
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