Commit 4b17b950 authored by strong's avatar strong

Merge branch 'remould_1214_api_optimize' into SANDBOX

parents 585ec733 b5c4418a
...@@ -11,6 +11,7 @@ var async = require('async'); ...@@ -11,6 +11,7 @@ var async = require('async');
var then = require('thenjs'); var then = require('thenjs');
var listThreadFields = { var listThreadFields = {
content:1, content:1,
type:1, type:1,
title:1, title:1,
...@@ -24,6 +25,8 @@ var listThreadFields = { ...@@ -24,6 +25,8 @@ var listThreadFields = {
comments:1, comments:1,
level:1, level:1,
top:1, top:1,
tag:1,
tag_top:1,
pv_count:1, pv_count:1,
address:1 address:1
...@@ -43,6 +46,8 @@ var singleThreadFields = { ...@@ -43,6 +46,8 @@ var singleThreadFields = {
images:1, images:1,
level:1, level:1,
top:1, top:1,
tag:1,
tag_top:1,
pv_count:1, pv_count:1,
address:1 address:1
...@@ -733,7 +738,7 @@ function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) { ...@@ -733,7 +738,7 @@ function getAllThreadByFidHelp(conditions, pageNo, pageSize, sort, callback) {
if (sort) { if (sort) {
sortBy = sort; sortBy = sort;
} }
ForumThread.find(conditions,listThreadFields).populate('from', 'uid mid nickName icon').populate('info','name icon pv_count').populate({ ForumThread.find(conditions).populate('from', 'uid mid nickName icon').populate('info','name icon pv_count').populate({
path: 'tag',select: 'title pv_count' path: 'tag',select: 'title pv_count'
}).populate({ }).populate({
path: 'comments', path: 'comments',
...@@ -800,7 +805,7 @@ function getAllThreadByFidHelpNoLimit(conditions, pageNo, pageSize, sort, callba ...@@ -800,7 +805,7 @@ function getAllThreadByFidHelpNoLimit(conditions, pageNo, pageSize, sort, callba
if (sort) { if (sort) {
sortBy = sort; sortBy = sort;
} }
ForumThread.find(conditions,listThreadFields).populate('from','uid mid nickName icon').populate('info','name icon pv_count').populate({ ForumThread.find(conditions).populate('from','uid mid nickName icon').populate('info','name icon pv_count').populate({
path: 'tag',select: 'title pv_count' path: 'tag',select: 'title pv_count'
}).populate({ }).populate({
path: 'comments', path: 'comments',
......
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