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
81be1a3b
Commit
81be1a3b
authored
Oct 28, 2015
by
刘文胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
656e7786
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
forumNotice.js
app/controllers/admin/forumNotice.js
+6
-1
No files found.
app/controllers/admin/forumNotice.js
View file @
81be1a3b
...
@@ -189,8 +189,8 @@ router.post('/notice/search', function(req, res, next) {
...
@@ -189,8 +189,8 @@ router.post('/notice/search', function(req, res, next) {
}
}
queryList
(
_condition
,
_sort
,
pageNo
,
pageSize
,
function
(
err
,
result
){
queryList
(
_condition
,
_sort
,
pageNo
,
pageSize
,
function
(
err
,
result
){
console
.
log
(
err
);
if
(
err
){
if
(
err
){
console
.
log
(
err
);
return
res
.
json
(
err
);
return
res
.
json
(
err
);
}
}
return
res
.
json
(
result
);
return
res
.
json
(
result
);
...
@@ -268,6 +268,7 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
...
@@ -268,6 +268,7 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
getAllOrderIDX
(
_condition
,
_sort
,
function
(
err
,
results
){
getAllOrderIDX
(
_condition
,
_sort
,
function
(
err
,
results
){
if
(
err
){
if
(
err
){
console
.
log
(
err
);
return
res
.
json
(
returnCode
.
BUSY
);
return
res
.
json
(
returnCode
.
BUSY
);
}
}
var
index
=-
1
;
var
index
=-
1
;
...
@@ -277,10 +278,12 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
...
@@ -277,10 +278,12 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
}
}
});
});
if
(
index
===
-
1
){
if
(
index
===
-
1
){
console
.
log
(
'没有找到对应项'
);
return
res
.
json
(
returnCode
.
BUSY
);
return
res
.
json
(
returnCode
.
BUSY
);
}
}
var
preObj
=
results
[
index
-
1
];
var
preObj
=
results
[
index
-
1
];
if
(
!
preObj
){
if
(
!
preObj
){
console
.
log
(
'已经是第一个了'
);
return
res
.
json
(
returnCode
.
BUSY
);
return
res
.
json
(
returnCode
.
BUSY
);
}
}
var
preidx
=
preObj
.
order_idx
;
var
preidx
=
preObj
.
order_idx
;
...
@@ -289,10 +292,12 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
...
@@ -289,10 +292,12 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
}
}
updateNoticIdx
(
id
,
preidx
,
function
(
err
,
result
){
updateNoticIdx
(
id
,
preidx
,
function
(
err
,
result
){
if
(
err
||
!
result
){
if
(
err
||
!
result
){
console
.
log
(
err
);
return
res
.
json
(
returnCode
.
BUSY
);
return
res
.
json
(
returnCode
.
BUSY
);
}
}
updateNoticIdx
(
preObj
.
_id
,
idx
,
function
(
err
,
result
){
updateNoticIdx
(
preObj
.
_id
,
idx
,
function
(
err
,
result
){
if
(
err
||
!
result
){
if
(
err
||
!
result
){
console
.
log
(
err
);
return
res
.
json
(
returnCode
.
BUSY
);
return
res
.
json
(
returnCode
.
BUSY
);
}
}
return
res
.
json
(
_
.
assign
({
data
:
true
},
returnCode
.
SUCCESS
));
return
res
.
json
(
_
.
assign
({
data
:
true
},
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