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
2f7c9a22
Commit
2f7c9a22
authored
Apr 01, 2016
by
陈家荣
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
23a191fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
forumInfo.js
app/controllers/mobile/forumInfo.js
+28
-1
No files found.
app/controllers/mobile/forumInfo.js
View file @
2f7c9a22
...
@@ -1044,6 +1044,34 @@ router.get('/info/getUserFavorInfo', function(req, res, next) {
...
@@ -1044,6 +1044,34 @@ router.get('/info/getUserFavorInfo', function(req, res, next) {
callback
(
err
,
datas
.
items
);
callback
(
err
,
datas
.
items
);
});
});
},
},
function
(
infos
,
callback
)
{
//获取关注数
var
asyncTasks
=
[];
_
.
forEach
(
infos
,
function
(
info
,
i
)
{
asyncTasks
.
push
(
function
(
cont
)
{
var
conditions
=
{
ent_code
:
ent_code
,
info
:
info
.
_id
};
forumFollowInfoService
.
count
(
conditions
,
function
(
err
,
count
)
{
if
(
err
)
{
console
.
error
(
err
);
cont
(
err
,
null
);
}
else
{
if
(
infos
[
i
].
toObject
)
{
infos
[
i
]
=
infos
[
i
].
toObject
();
}
infos
[
i
].
favor_by
=
count
;
cont
(
null
,
info
);
}
});
});
});
then
.
parallel
(
asyncTasks
).
then
(
function
(
cont
,
datas
)
{
callback
(
null
,
infos
);
}).
fail
(
function
(
err
,
cont
)
{
callback
(
err
,
null
);
});
},
function
(
infos
,
callback
)
{
//获取用户
function
(
infos
,
callback
)
{
//获取用户
var
asyncTasks
=
[];
var
asyncTasks
=
[];
_
.
forEach
(
infos
,
function
(
info
,
i
)
{
_
.
forEach
(
infos
,
function
(
info
,
i
)
{
...
@@ -1070,7 +1098,6 @@ router.get('/info/getUserFavorInfo', function(req, res, next) {
...
@@ -1070,7 +1098,6 @@ router.get('/info/getUserFavorInfo', function(req, res, next) {
if
(
infos
[
i
].
toObject
)
{
if
(
infos
[
i
].
toObject
)
{
infos
[
i
]
=
infos
[
i
].
toObject
();
infos
[
i
]
=
infos
[
i
].
toObject
();
}
}
infos
[
i
].
favor_by
=
infos
[
i
].
favor_by
.
length
;
infos
[
i
].
threadCount
=
count
;
infos
[
i
].
threadCount
=
count
;
cont
(
null
,
info
);
cont
(
null
,
info
);
}
}
...
...
strong
@strong
mentioned in commit
c11ca386
·
Apr 05, 2016
mentioned in commit
c11ca386
mentioned in commit c11ca38643a075758186ca6e205ab38e18df2a48
Toggle commit list
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