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
14b57d23
Commit
14b57d23
authored
Aug 06, 2015
by
陈志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
45ffbc06
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
3 deletions
+48
-3
forumInfo.js
app/controllers/admin/forumInfo.js
+24
-0
forumThread.js
app/controllers/admin/forumThread.js
+4
-2
forumInfoService.js
app/service/forumInfoService.js
+14
-0
forumUserService.js
app/service/forumUserService.js
+6
-1
No files found.
app/controllers/admin/forumInfo.js
View file @
14b57d23
...
...
@@ -468,4 +468,28 @@ router.get('/info/report/exportXlsReport/:id', function(req, res, next) {
err
:
'参数不合法'
});
}
});
//获取默认版块(创建时间最早的版块)
router
.
get
(
'/info/default'
,
function
(
req
,
res
,
next
)
{
var
rs
=
{};
var
ent_code
=
req
.
query
.
ent_code
;
if
(
ent_code
){
var
conditions
=
{
ent_code
:
ent_code
};
var
sort
=
'created'
forumInfoService
.
getOneInfoByConditionsAndSort
(
conditions
,
sort
,
function
(
err
,
info
){
if
(
err
){
console
.
error
(
err
);
res
.
json
(
returnCode
.
BUSY
);
}
else
{
rs
.
data
=
info
;
res
.
json
(
_
.
assign
(
rs
,
returnCode
.
SUCCESS
));
}
});
}
else
{
res
.
json
(
returnCode
.
BUSY
);
}
});
\ No newline at end of file
app/controllers/admin/forumThread.js
View file @
14b57d23
...
...
@@ -149,8 +149,10 @@ router.get('/thread/:tid/get', function(req, res, next) {
res
.
json
(
returnCode
.
BUSY
);
}
else
{
var
isSameAuthor
=
false
;
if
(
results
[
0
]
&&
results
[
2
]
&&
results
[
0
].
from
&&
results
[
0
].
from
.
_id
.
toString
()
===
results
[
2
].
_id
.
toString
()){
isSameAuthor
=
true
;
if
(
results
[
0
].
from
&&
results
[
0
].
from
.
uid
){
if
(
!
isNaN
(
results
[
0
].
from
.
uid
)){
isSameAuthor
=
true
;
}
}
if
(
results
[
0
].
pid
)
{
...
...
app/service/forumInfoService.js
View file @
14b57d23
...
...
@@ -104,3 +104,17 @@ exports.updateInfoPvCount=function(fid,callback){
}
});
};
//获取板块
//获取全部列表数据
exports
.
getOneInfoByConditionsAndSort
=
function
(
conditions
,
sort
,
callback
)
{
ForumInfo
.
findOne
(
conditions
).
sort
(
sort
).
exec
(
function
(
err
,
doc
)
{
if
(
err
||
!
doc
)
{
console
.
error
(
err
);
callback
(
err
,
null
);
}
else
{
callback
(
null
,
doc
);
}
});
};
\ No newline at end of file
app/service/forumUserService.js
View file @
14b57d23
...
...
@@ -170,7 +170,12 @@ exports.searchMembersAndLimitActions=function(pageNo, pageSize, q, callback){
//根据nickName查询用户
exports
.
searchMembersByNickName
=
function
(
nickName
,
callback
){
var
name
=
{
nickName
:
{
$regex
:
nickName
,
$options
:
'i'
}
};
var
name
=
{
$or
:
[
{
nickName
:
{
$regex
:
nickName
,
$options
:
'i'
}},
{
displayName
:
{
$regex
:
nickName
,
$options
:
'i'
}}
]
};
ForumUser
.
find
(
name
).
exec
(
function
(
err
,
result
){
if
(
err
){
callback
(
err
,
null
);
...
...
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