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
12f98f59
Commit
12f98f59
authored
Sep 16, 2015
by
刘文胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的消息 关于我的
parent
4c4eff05
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
forumThread.js
app/controllers/mobile/forumThread.js
+2
-2
forumAboutMe.js
app/models/forumAboutMe.js
+6
-0
forumAboutMEService.js
app/service/forumAboutMEService.js
+4
-2
forumThreadService.js
app/service/forumThreadService.js
+1
-1
No files found.
app/controllers/mobile/forumThread.js
View file @
12f98f59
...
@@ -953,10 +953,10 @@ router.post('/thread/:tid/comment/:cid/disable', function(req, res, next) {
...
@@ -953,10 +953,10 @@ router.post('/thread/:tid/comment/:cid/disable', function(req, res, next) {
res
.
json
(
returnCode
.
BUSY
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
}
else
{
if
(
comment
&&
comment
.
level
==
1
){
if
(
comment
&&
comment
.
level
==
1
){
forumAboutMEService
.
updateCommentLevel1Status
(
comment
.
_id
,
comment
.
status
);
forumAboutMEService
.
updateCommentLevel1Status
(
comment
.
_id
,
2
);
}
}
if
(
comment
&&
comment
.
level
==
2
){
if
(
comment
&&
comment
.
level
==
2
){
forumAboutMEService
.
updateCommentLevel2Status
(
comment
.
_id
,
comment
.
status
);
forumAboutMEService
.
updateCommentLevel2Status
(
comment
.
_id
,
2
);
}
}
res
.
json
(
returnCode
.
SUCCESS
);
res
.
json
(
returnCode
.
SUCCESS
);
}
}
...
...
app/models/forumAboutMe.js
View file @
12f98f59
...
@@ -23,6 +23,7 @@ var ForumAboutMeSchema = new Schema({
...
@@ -23,6 +23,7 @@ var ForumAboutMeSchema = new Schema({
},
},
type
:{
//分类 1帖子 2一级评论 3二级评论
type
:{
//分类 1帖子 2一级评论 3二级评论
type
:
Number
,
type
:
Number
,
index
:
true
,
require
:
true
,
require
:
true
,
default
:
0
default
:
0
},
},
...
@@ -50,6 +51,11 @@ var ForumAboutMeSchema = new Schema({
...
@@ -50,6 +51,11 @@ var ForumAboutMeSchema = new Schema({
index
:
true
,
index
:
true
,
ref
:
'ForumComment'
ref
:
'ForumComment'
},
},
commentLevel2ThreadFrom
:{
//二级评论对应的帖子的发帖人
type
:
Schema
.
Types
.
ObjectId
,
require
:
false
,
ref
:
'ForumUser'
},
commentLevel2Status
:{
commentLevel2Status
:{
type
:
Number
type
:
Number
},
},
...
...
app/service/forumAboutMEService.js
View file @
12f98f59
...
@@ -53,6 +53,7 @@ exports.saveCommentLevel2=function(tid,commentLevel1,commentLevel2){
...
@@ -53,6 +53,7 @@ exports.saveCommentLevel2=function(tid,commentLevel1,commentLevel2){
commentLevel1
:
commentLevel1
.
_id
,
commentLevel1
:
commentLevel1
.
_id
,
commentLevel1Status
:
commentLevel1
.
status
,
commentLevel1Status
:
commentLevel1
.
status
,
commentLevel2
:
commentLevel2
.
_id
,
commentLevel2
:
commentLevel2
.
_id
,
commentLevel2ThreadFrom
:
thread
.
from
,
commentLevel2Status
:
commentLevel2
.
status
,
commentLevel2Status
:
commentLevel2
.
status
,
created
:
new
Date
()
created
:
new
Date
()
});
});
...
@@ -87,6 +88,7 @@ exports.saveCommentLevel2BySearch=function(tid,l1id,l2id){
...
@@ -87,6 +88,7 @@ exports.saveCommentLevel2BySearch=function(tid,l1id,l2id){
commentLevel1
:
commentLevel1
.
_id
,
commentLevel1
:
commentLevel1
.
_id
,
commentLevel1Status
:
commentLevel1
.
status
,
commentLevel1Status
:
commentLevel1
.
status
,
commentLevel2
:
commentLevel2
.
_id
,
commentLevel2
:
commentLevel2
.
_id
,
commentLevel2ThreadFrom
:
thread
.
from
,
commentLevel2Status
:
commentLevel2
.
status
,
commentLevel2Status
:
commentLevel2
.
status
,
created
:
new
Date
()
created
:
new
Date
()
});
});
...
@@ -201,7 +203,7 @@ exports.me2other=function(ent_code,id,pageNo,pageSize,callback){
...
@@ -201,7 +203,7 @@ exports.me2other=function(ent_code,id,pageNo,pageSize,callback){
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
var
sortBy
=
'-created'
;
var
sortBy
=
'-created'
;
ForumAboutMe
.
find
(
condition
).
populate
({
ForumAboutMe
.
find
(
condition
).
populate
({
path
:
'from to'
,
path
:
'from to
commentLevel2ThreadFrom
'
,
select
:
'uid nickName icon displayName displayIcon classLevel'
select
:
'uid nickName icon displayName displayIcon classLevel'
}).
populate
({
}).
populate
({
path
:
'thread'
,
path
:
'thread'
,
...
@@ -245,7 +247,7 @@ exports.other2me=function(ent_code,id,pageNo,pageSize,callback){
...
@@ -245,7 +247,7 @@ exports.other2me=function(ent_code,id,pageNo,pageSize,callback){
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
var
limit
=
count
-
skip
>
pageSize
?
pageSize
:
(
count
-
skip
);
var
sortBy
=
'-created'
;
var
sortBy
=
'-created'
;
ForumAboutMe
.
find
(
condition
).
populate
({
ForumAboutMe
.
find
(
condition
).
populate
({
path
:
'from to'
,
path
:
'from to
commentLevel2ThreadFrom
'
,
select
:
'uid nickName icon displayName displayIcon classLevel'
select
:
'uid nickName icon displayName displayIcon classLevel'
}).
populate
({
}).
populate
({
path
:
'thread'
,
path
:
'thread'
,
...
...
app/service/forumThreadService.js
View file @
12f98f59
...
@@ -250,7 +250,7 @@ exports.getThreadById = function(tid, callback) {
...
@@ -250,7 +250,7 @@ exports.getThreadById = function(tid, callback) {
var
hotPhotos
=
results
[
4
]
||
[];
//最热照片墙列表
var
hotPhotos
=
results
[
4
]
||
[];
//最热照片墙列表
var
canyuPeopleCount
=
results
[
5
]
||
0
;
//参与人数
var
canyuPeopleCount
=
results
[
5
]
||
0
;
//参与人数
var
threadObj
=
thread
.
toObject
()
;
var
threadObj
=
thread
&&
thread
.
toObject
()
||
{}
;
threadObj
.
comments
=
comments
;
threadObj
.
comments
=
comments
;
threadObj
.
subThreads
=
subThreads
;
threadObj
.
subThreads
=
subThreads
;
threadObj
.
latestPhotos
=
latestPhotos
;
threadObj
.
latestPhotos
=
latestPhotos
;
...
...
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