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
974f1dd2
Commit
974f1dd2
authored
Feb 18, 2016
by
刘文胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111111111
parent
acdb51d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
forumThread.js
app/controllers/mobile/forumThread.js
+2
-2
redisThreadList.js
app/utils/redisThreadList.js
+2
-3
No files found.
app/controllers/mobile/forumThread.js
View file @
974f1dd2
...
...
@@ -1911,7 +1911,7 @@ router.get('/thread/getThreadWithEssence', function(req, res, next) {
});
}
else
{
//更新推荐列表redis
redisThreadList
.
get
(
ent_code
,
""
,
redis_type
,
function
(
error
,
docs
)
{
redisThreadList
.
get
(
ent_code
,
""
,
redis_type
,
sort
,
function
(
error
,
docs
)
{
var
results
=
JSON
.
parse
(
docs
);
if
(
results
.
items
==
null
){
//如果不存在,继续重新获取
redisThreadList
.
getRedisEsenceThreads
(
ent_code
,
""
,
redis_type
,
sort
,
function
(
error
,
docs
){
...
...
@@ -1962,7 +1962,7 @@ function handleThreadList(req, results, ent_code, callback){
}
//获取等级最高的荣誉
if
(
results
.
items
[
i
].
from
.
honorTitles
&&
results
.
items
[
i
].
from
.
honorTitles
.
length
>
0
){
if
(
results
.
items
[
i
].
from
&&
results
.
items
[
i
].
from
.
honorTitles
&&
results
.
items
[
i
].
from
.
honorTitles
.
length
>
0
){
var
temp_honorTitles
=
_
.
sortBy
(
results
.
items
[
i
].
from
.
honorTitles
,
'order_idx'
)
for
(
var
m
=
temp_honorTitles
.
length
-
1
;
m
>=
0
;
m
-=
1
){
var
honor
=
temp_honorTitles
[
m
]
...
...
app/utils/redisThreadList.js
View file @
974f1dd2
...
...
@@ -29,7 +29,7 @@ function setToRedis(ent_code,keyID,type,value){
});
}
exports
.
get
=
function
(
ent_code
,
keyID
,
type
,
callback
){
exports
.
get
=
function
(
ent_code
,
keyID
,
type
,
sort
,
callback
){
var
key
=
getKey
(
ent_code
,
keyID
,
type
);
if
(
!
redis
){
console
.
log
(
'redis error'
);
...
...
@@ -38,7 +38,7 @@ exports.get=function(ent_code,keyID,type,callback){
redis
.
get
(
key
,
function
(
error
,
res
){
if
(
!
res
){
//不存在,先获取再返回
getEsenceThreads
(
ent_code
,
keyID
,
type
,
function
(
err
){
getEsenceThreads
(
ent_code
,
keyID
,
type
,
sort
,
function
(
err
){
redis
.
get
(
key
,
function
(
error
,
res
){
return
callback
&&
callback
(
error
,
res
.
split
(
","
));
});
...
...
@@ -115,7 +115,6 @@ exports.getRedisEsenceThreads = function(ent_code,keyID,type,sort,callback){
//更新缓存列表
exports
.
updateRedisEsenceThreads
=
function
(
ent_code
,
keyID
,
type
,
callback
){
var
key
=
getKey
(
ent_code
,
keyID
,
type
);
getEsenceThreads
(
ent_code
,
keyID
,
type
,
function
(
err
){
callback
();
});
...
...
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