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
2b1df705
Commit
2b1df705
authored
Oct 28, 2015
by
刘文胜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1111
parent
81be1a3b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
12 deletions
+8
-12
forumInfo.js
app/controllers/admin/forumInfo.js
+1
-2
forumNotice.js
app/controllers/admin/forumNotice.js
+3
-5
forumTag.js
app/controllers/admin/forumTag.js
+1
-2
forumNotice.js
app/controllers/mobile/forumNotice.js
+3
-3
No files found.
app/controllers/admin/forumInfo.js
View file @
2b1df705
...
@@ -231,8 +231,7 @@ router.put('/infos/moveUP/:id/:order', function(req, res, next) {
...
@@ -231,8 +231,7 @@ router.put('/infos/moveUP/:id/:order', function(req, res, next) {
var
groupId
=
req
.
body
.
groupId
||
null
;
var
groupId
=
req
.
body
.
groupId
||
null
;
var
infoName
=
req
.
body
.
infoName
||
null
;
var
infoName
=
req
.
body
.
infoName
||
null
;
var
conditions
=
{
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
ent_code
:
req
.
session
.
user
.
ent_code
order_idx
:{
$gte
:
idx
}
};
};
if
(
groupId
){
if
(
groupId
){
conditions
.
group
=
groupId
;
conditions
.
group
=
groupId
;
...
...
app/controllers/admin/forumNotice.js
View file @
2b1df705
...
@@ -129,7 +129,7 @@ router.post('/notice/search', function(req, res, next) {
...
@@ -129,7 +129,7 @@ router.post('/notice/search', function(req, res, next) {
top
=
req
.
body
.
top
,
top
=
req
.
body
.
top
,
status
=
req
.
body
.
status
,
status
=
req
.
body
.
status
,
finished
=
req
.
body
.
finished
;
finished
=
req
.
body
.
finished
;
var
_condition
=
{
ent_code
:
req
.
session
.
user
.
ent_code
},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
,
createtime
:
-
1
};
var
_condition
=
{
ent_code
:
req
.
session
.
user
.
ent_code
},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
};
if
(
title
){
if
(
title
){
_condition
.
title
=
new
RegExp
(
title
,
'i'
);
_condition
.
title
=
new
RegExp
(
title
,
'i'
);
...
@@ -212,7 +212,7 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
...
@@ -212,7 +212,7 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
top
=
req
.
body
.
top
,
top
=
req
.
body
.
top
,
status
=
req
.
body
.
status
,
status
=
req
.
body
.
status
,
finished
=
req
.
body
.
finished
;
finished
=
req
.
body
.
finished
;
var
_condition
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
order_idx
:{
$gte
:
idx
}},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
,
createtime
:
-
1
};
var
_condition
=
{
ent_code
:
req
.
session
.
user
.
ent_code
},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
};
if
(
title
){
if
(
title
){
_condition
.
title
=
new
RegExp
(
title
,
'i'
);
_condition
.
title
=
new
RegExp
(
title
,
'i'
);
}
}
...
@@ -265,7 +265,6 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
...
@@ -265,7 +265,6 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
if
(
!!
plate
){
if
(
!!
plate
){
_condition
.
plate
=
plate
;
_condition
.
plate
=
plate
;
}
}
getAllOrderIDX
(
_condition
,
_sort
,
function
(
err
,
results
){
getAllOrderIDX
(
_condition
,
_sort
,
function
(
err
,
results
){
if
(
err
){
if
(
err
){
console
.
log
(
err
);
console
.
log
(
err
);
...
@@ -273,17 +272,16 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
...
@@ -273,17 +272,16 @@ router.put('/notice/moveUP/:id/:order', function(req, res, next) {
}
}
var
index
=-
1
;
var
index
=-
1
;
_
.
forEach
(
results
,
function
(
r
,
i
){
_
.
forEach
(
results
,
function
(
r
,
i
){
console
.
log
(
r
.
_id
.
toString
(),
id
.
toString
());
if
(
r
.
_id
.
toString
()
===
id
.
toString
()){
if
(
r
.
_id
.
toString
()
===
id
.
toString
()){
index
=
i
;
index
=
i
;
}
}
});
});
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
;
...
...
app/controllers/admin/forumTag.js
View file @
2b1df705
...
@@ -103,8 +103,7 @@ router.put('/tag/moveUP/:id/:order', function(req, res, next) {
...
@@ -103,8 +103,7 @@ router.put('/tag/moveUP/:id/:order', function(req, res, next) {
var
info
=
req
.
query
.
info
||
''
;
var
info
=
req
.
query
.
info
||
''
;
var
conditions
=
{
var
conditions
=
{
ent_code
:
req
.
session
.
user
.
ent_code
,
ent_code
:
req
.
session
.
user
.
ent_code
order_idx
:{
$gte
:
idx
}
};
};
if
(
tagName
){
if
(
tagName
){
conditions
.
title
=
{
conditions
.
title
=
{
...
...
app/controllers/mobile/forumNotice.js
View file @
2b1df705
...
@@ -94,7 +94,7 @@ router.get('/notice/newestMsg', function(req, res, next) {
...
@@ -94,7 +94,7 @@ router.get('/notice/newestMsg', function(req, res, next) {
pageSize
=
req
.
query
.
pageSize
,
pageSize
=
req
.
query
.
pageSize
,
plate
=
req
.
query
.
plate
;
plate
=
req
.
query
.
plate
;
var
_condition
=
{
status
:
1
,
type
:
2
,
ent_code
:
req
.
session
.
user
.
ent_code
},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
,
createtime
:
-
1
};
var
_condition
=
{
status
:
1
,
type
:
2
,
ent_code
:
req
.
session
.
user
.
ent_code
},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
};
if
(
plate
){
if
(
plate
){
_condition
.
$or
=
[{
plate
:
plate
},{
plate
:
null
}];
_condition
.
$or
=
[{
plate
:
plate
},{
plate
:
null
}];
}
else
{
}
else
{
...
@@ -128,7 +128,7 @@ router.get('/notice/newestAct', function(req, res, next) {
...
@@ -128,7 +128,7 @@ router.get('/notice/newestAct', function(req, res, next) {
ent_code
:
req
.
session
.
user
.
ent_code
,
ent_code
:
req
.
session
.
user
.
ent_code
,
startdate
:{
$lte
:
curdate
},
startdate
:{
$lte
:
curdate
},
indate
:{
$gte
:
curdate
},
indate
:{
$gte
:
curdate
},
},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
,
createtime
:
-
1
};
},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
};
if
(
plate
){
if
(
plate
){
_condition
.
$or
=
[{
plate
:
plate
},{
plate
:
null
}];
_condition
.
$or
=
[{
plate
:
plate
},{
plate
:
null
}];
}
else
{
}
else
{
...
@@ -157,7 +157,7 @@ router.get('/notice/oldAct', function(req, res, next) {
...
@@ -157,7 +157,7 @@ router.get('/notice/oldAct', function(req, res, next) {
plate
=
req
.
query
.
plate
,
plate
=
req
.
query
.
plate
,
curdate
=
new
Date
(),
curdate
=
new
Date
(),
_condition
=
{
status
:
1
,
type
:
1
,
ent_code
:
req
.
session
.
user
.
ent_code
,
$or
:[{
indate
:{
$lt
:
curdate
}},{
finished
:
1
}]},
_condition
=
{
status
:
1
,
type
:
1
,
ent_code
:
req
.
session
.
user
.
ent_code
,
$or
:[{
indate
:{
$lt
:
curdate
}},{
finished
:
1
}]},
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
,
createtime
:
-
1
};
_sort
=
{
top
:
-
1
,
order_idx
:
-
1
};
if
(
plate
){
if
(
plate
){
_condition
.
$or
=
[{
plate
:
plate
},{
plate
:
null
}];
_condition
.
$or
=
[{
plate
:
plate
},{
plate
:
null
}];
}
else
{
}
else
{
...
...
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