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
811fcebd
Commit
811fcebd
authored
Dec 17, 2015
by
杨翌文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化查询版块的逻辑
parent
d001a011
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
forumInfo.js
app/controllers/mobile/forumInfo.js
+11
-16
No files found.
app/controllers/mobile/forumInfo.js
View file @
811fcebd
...
@@ -68,18 +68,13 @@ router.get('/info/:fid/get', function(req, res, next) {
...
@@ -68,18 +68,13 @@ router.get('/info/:fid/get', function(req, res, next) {
if
(
fid
)
{
if
(
fid
)
{
var
source
=
req
.
session
.
mobileForumUser
.
source
;
var
source
=
req
.
session
.
mobileForumUser
.
source
;
httpService
.
createLog
(
req
,
source
,
fid
,
2
);
httpService
.
createLog
(
req
,
source
,
fid
,
2
);
async
.
waterfall
([
forumInfoService
.
updateInfoPvCount
(
fid
,
function
(
err
,
result
)
{
if
(
err
)
{
console
.
error
(
err
);
}
});
async
.
parallel
([
function
(
callback
)
{
function
(
callback
)
{
//更新浏览数
forumInfoService
.
updateInfoPvCount
(
fid
,
function
(
err
,
result
)
{
if
(
err
)
{
callback
(
err
,
null
);
}
else
{
callback
(
null
,
null
);
}
});
},
function
(
data
,
callback
)
{
forumInfoService
.
getInfoById
(
fid
,
function
(
err
,
info
)
{
forumInfoService
.
getInfoById
(
fid
,
function
(
err
,
info
)
{
if
(
err
)
{
if
(
err
)
{
callback
(
err
,
null
);
callback
(
err
,
null
);
...
@@ -93,20 +88,20 @@ router.get('/info/:fid/get', function(req, res, next) {
...
@@ -93,20 +88,20 @@ router.get('/info/:fid/get', function(req, res, next) {
info
:
fid
info
:
fid
},
function
(
err
,
threadCount
)
{
},
function
(
err
,
threadCount
)
{
if
(
err
)
{
if
(
err
)
{
callback
(
err
,
null
,
null
);
callback
(
err
,
null
);
}
else
{
}
else
{
callback
(
null
,
info
,
threadCount
);
callback
(
null
,
threadCount
);
}
}
});
});
}
}
],
function
(
err
,
info
,
threadCount
)
{
],
function
(
err
,
results
)
{
if
(
err
)
{
if
(
err
)
{
console
.
error
(
err
);
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
var
rs
=
{};
var
rs
=
{};
rs
.
data
=
info
;
rs
.
data
=
results
[
0
]
;
rs
.
data
.
threadCount
=
threadCount
;
rs
.
data
.
threadCount
=
results
[
1
]
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
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