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
09c10ee1
Commit
09c10ee1
authored
Mar 18, 2016
by
陈家荣
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新荣誉头衔和后台发的子话题不显示
parent
6404a060
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
30 deletions
+29
-30
forumHonorTitle.js
app/controllers/mobile/forumHonorTitle.js
+24
-0
forumThread.js
app/controllers/mobile/forumThread.js
+5
-30
No files found.
app/controllers/mobile/forumHonorTitle.js
View file @
09c10ee1
...
...
@@ -108,4 +108,28 @@ router.get('/honorTitle/list', function(req, res, next) {
res
.
json
(
_
.
assign
(
result
,
returnCode
.
SUCCESS
));
}
});
});
//获取状态为启用的
router
.
get
(
'/honorTitle/allList'
,
function
(
req
,
res
,
next
)
{
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
status
:
1
};
forumHonorTitleService
.
find
(
conditions
,
function
(
err
,
results
){
if
(
err
){
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
var
map
=
{};
_
.
forEach
(
results
,
function
(
d
,
i
)
{
map
[
d
.
_id
]
=
d
;
});
var
rs
=
{
data
:
map
};
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
}
});
});
\ No newline at end of file
app/controllers/mobile/forumThread.js
View file @
09c10ee1
...
...
@@ -569,17 +569,6 @@ router.get('/thread/:tid/get', function(req, res, next) {
if
(
thread
.
toObject
)
{
thread
=
thread
.
toObject
();
}
//获取等级最高的荣誉
if
(
thread
.
from
&&
thread
.
from
.
honorTitles
&&
thread
.
from
.
honorTitles
.
length
>
0
){
var
temp_honorTitles
=
_
.
sortBy
(
thread
.
from
.
honorTitles
,
'order_idx'
);
for
(
var
m
=
temp_honorTitles
.
length
-
1
;
m
>=
0
;
m
-=
1
){
var
honor
=
temp_honorTitles
[
m
]
if
(
honor
.
is_show
==
1
){
thread
.
from
.
honorTitles
=
honor
;
break
;
}
}
}
var
threads
=
[];
threads
.
push
(
thread
);
util
.
loadLevel
(
req
.
session
.
user
.
ent_code
,
threads
,
function
()
{
...
...
@@ -1695,10 +1684,8 @@ router.get('/thread/:tid/topics', function(req, res, next) {
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
pid
:
tid
,
type
:
2
,
status
:
{
$ne
:
3
}
// type: 2,
status
:
1
};
if
(
tid
)
{
async
.
waterfall
([
...
...
@@ -1750,7 +1737,7 @@ router.get('/thread/:tid/latestPhotos', function(req, res, next) {
var
conditions
=
{
ent_code
:
ent_code
,
pid
:
tid
,
type
:
3
,
//
type: 3,
status
:
1
,
images
:
{
$exists
:
true
,
...
...
@@ -1824,7 +1811,7 @@ router.get('/thread/:tid/hotPhotos', function(req, res, next) {
var
conditions
=
{
ent_code
:
ent_code
,
pid
:
tid
,
type
:
3
,
//
type: 3,
status
:
1
,
images
:
{
$exists
:
true
,
...
...
@@ -2064,18 +2051,6 @@ function handleThreadList(req, results, ent_code, callback){
}
}
//获取等级最高的荣誉
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
]
if
(
honor
.
is_show
==
1
){
results
.
items
[
i
].
from
.
honorTitles
=
honor
;
break
;
}
}
}
results
.
items
[
i
].
isPraise
=
false
;
for
(
var
k
=
docs
.
length
-
1
;
k
>=
0
;
k
--
)
{
if
(
results
.
items
[
i
].
_id
==
docs
[
k
])
{
...
...
@@ -2144,7 +2119,7 @@ router.get('/thread/:tid/get/subThreads/:type', function(req, res, next) {
var
conditions
=
{
ent_code
:
ent_code
,
pid
:
tid
,
type
:
2
,
//
type: 2,
status
:
1
};
...
...
strong
@strong
mentioned in commit
6edf6c04
·
Mar 18, 2016
mentioned in commit
6edf6c04
mentioned in commit 6edf6c04602fd587aba1805fc1b508dddbc04307
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