Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pisns-forum-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
scrmGroup
pisns-forum-api
Commits
2a9a5b2d
Commit
2a9a5b2d
authored
Jan 25, 2016
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取帖子列表
parent
1d7327e0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
forumThread.js
app/controllers/mobile/forumThread.js
+15
-2
forumThreadService.js
app/service/forumThreadService.js
+7
-4
No files found.
app/controllers/mobile/forumThread.js
View file @
2a9a5b2d
...
...
@@ -1815,7 +1815,13 @@ router.get('/thread/getThreadWithEssence', function(req, res, next) {
results
.
items
[
i
].
eventStatus
=
1
;
//'进行中';
}
}
//获取等级最高的荣誉
if
(
results
.
items
[
i
].
from
.
honorTitles
&&
results
.
items
[
i
].
from
.
honorTitles
.
length
>
0
){
var
temp_honorTitles
=
_
.
sortBy
(
results
.
items
[
i
].
from
.
honorTitles
,
'order_idx'
)
results
.
items
[
i
].
from
.
honorTitles
=
temp_honorTitles
[
temp_honorTitles
.
length
-
1
];
}
results
.
items
[
i
].
isPraise
=
false
;
for
(
var
k
=
docs
.
length
-
1
;
k
>=
0
;
k
--
)
{
if
(
results
.
items
[
i
].
_id
==
docs
[
k
])
{
...
...
@@ -1867,7 +1873,7 @@ router.get('/thread/searchThread', function(req, res, next) {
router
.
get
(
'/thread/getThreadWithNotPopulateComment'
,
function
(
req
,
res
,
next
)
{
var
pageNo
=
req
.
query
.
pageNo
||
1
;
var
pageSize
=
req
.
query
.
pageSize
||
10
;
var
sort
=
'-
top -topTime -quality -
created'
;
var
sort
=
'-created'
;
var
ent_code
=
req
.
session
.
user
.
ent_code
;
var
today
=
new
Date
();
var
conditions
=
{
...
...
@@ -1903,6 +1909,13 @@ router.get('/thread/getThreadWithNotPopulateComment', function(req, res, next) {
results
.
items
[
i
].
eventStatus
=
1
;
//'进行中';
}
}
//获取等级最高的荣誉
if
(
results
.
items
[
i
].
from
.
honorTitles
&&
results
.
items
[
i
].
from
.
honorTitles
.
length
>
0
){
var
temp_honorTitles
=
_
.
sortBy
(
results
.
items
[
i
].
from
.
honorTitles
,
'order_idx'
)
results
.
items
[
i
].
from
.
honorTitles
=
temp_honorTitles
[
temp_honorTitles
.
length
-
1
];
}
results
.
items
[
i
].
isPraise
=
false
;
for
(
var
k
=
docs
.
length
-
1
;
k
>=
0
;
k
--
)
{
if
(
results
.
items
[
i
].
_id
==
docs
[
k
])
{
...
...
app/service/forumThreadService.js
View file @
2a9a5b2d
...
...
@@ -1287,16 +1287,19 @@ exports.getThreadWithNotPopulateComment = function(conditions, pageNo, pageSize,
obj
.
pageNo
=
pageNo
;
obj
.
pageSize
=
pageSize
;
obj
.
items
=
docs
;
if
(
docs
&&
docs
.
length
>
0
)
{
var
asyncTasks
=
[];
docs
.
forEach
(
function
(
doc
)
{
if
(
!
(
doc
.
type
===
1
||
doc
.
level
!==
1
))
{
//照片墙或文章时获取参与用户
if
(
doc
.
type
===
1
||
doc
.
level
!==
1
)
{
//非照片墙或文章时获取评论
asyncTasks
.
push
(
function
(
callback
)
{
callback
(
null
,
doc
);
});
}
else
{
asyncTasks
.
push
(
function
(
callback
)
{
getSubThreads
(
doc
,
null
,
callback
);
});
}
}
});
async
.
parallel
(
asyncTasks
,
function
(
err
,
results
)
{
if
(
err
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment