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
db927e6d
Commit
db927e6d
authored
Jul 06, 2016
by
陈家荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
在帖子详情页,也要将用户的exp经验值带上
parent
8586daff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
forumThread.js
app/controllers/admin/forumThread.js
+18
-1
No files found.
app/controllers/admin/forumThread.js
View file @
db927e6d
...
...
@@ -156,6 +156,7 @@ router.post('/thread/create', function(req, res, next) {
router
.
get
(
'/thread/:tid/get'
,
function
(
req
,
res
,
next
)
{
var
uid
=
req
.
session
.
user
.
id
;
var
tid
=
req
.
params
.
tid
||
null
;
var
ent_code
=
req
.
session
.
user
.
ent_code
;
var
rs
=
{};
if
(
tid
)
{
async
.
waterfall
([
...
...
@@ -171,7 +172,7 @@ router.get('/thread/:tid/get', function(req, res, next) {
function
(
thread
,
callback
)
{
if
(
thread
&&
thread
.
info
&&
thread
.
info
.
_id
)
{
forumTagService
.
getAllTag
({
ent_code
:
req
.
session
.
user
.
ent_code
,
ent_code
:
ent_code
,
info
:
thread
.
info
.
_id
},
1
,
100
,
function
(
err
,
results
)
{
if
(
err
)
{
...
...
@@ -194,6 +195,20 @@ router.get('/thread/:tid/get', function(req, res, next) {
callback
(
null
,
datas
);
}
});
},
function
(
datas
,
callback
)
{
//获取EXP
if
(
datas
[
0
].
from
.
mid
){
userUtil
.
getMemberExp
(
ent_code
,
datas
[
0
].
from
.
mid
,
3
,
function
(
err
,
results
)
{
if
(
err
)
{
callback
(
err
,
null
);
}
else
{
datas
.
push
(
results
)
callback
(
null
,
datas
);
}
});
}
else
{
callback
(
null
,
datas
);
}
}
],
function
(
err
,
results
)
{
if
(
err
)
{
...
...
@@ -209,6 +224,7 @@ router.get('/thread/:tid/get', function(req, res, next) {
if
(
results
[
0
].
pid
)
{
forumThreadService
.
getById
(
results
[
0
].
pid
,
function
(
err
,
parentThread
)
{
rs
.
data
=
results
[
0
];
rs
.
data
.
from
.
exp
=
results
[
3
]
&&
results
[
3
].
allExp
?
results
[
3
].
allExp
:
0
;
rs
.
tagList
=
results
[
1
];
rs
.
parentThread
=
parentThread
;
rs
.
isSameAuthor
=
isSameAuthor
;
...
...
@@ -216,6 +232,7 @@ router.get('/thread/:tid/get', function(req, res, next) {
});
}
else
{
rs
.
data
=
results
[
0
];
rs
.
data
.
from
.
exp
=
results
[
3
]
&&
results
[
3
].
allExp
?
results
[
3
].
allExp
:
0
;
rs
.
tagList
=
results
[
1
];
rs
.
isSameAuthor
=
isSameAuthor
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
...
...
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