Commit 720ed72c authored by strong's avatar strong

Merge remote-tracking branch 'origin/remould_0303_new_plate' into SANDBOX

parents 85f527c2 8788428c
...@@ -64,6 +64,8 @@ router.post('/info/create', function(req, res, next) { ...@@ -64,6 +64,8 @@ router.post('/info/create', function(req, res, next) {
router.get('/info/:fid/get', function(req, res, next) { router.get('/info/:fid/get', function(req, res, next) {
var fid = req.params.fid || null; var fid = req.params.fid || null;
if (fid) { if (fid) {
var ent_code = req.session.user.ent_code;
var today = new Date();
var source = req.session.mobileForumUser.source; var source = req.session.mobileForumUser.source;
httpService.createLog(req, source, fid, 2); httpService.createLog(req, source, fid, 2);
forumInfoService.updateInfoPvCount(fid, function(err, result) { forumInfoService.updateInfoPvCount(fid, function(err, result) {
...@@ -82,9 +84,22 @@ router.get('/info/:fid/get', function(req, res, next) { ...@@ -82,9 +84,22 @@ router.get('/info/:fid/get', function(req, res, next) {
}); });
}, },
function(callback) { function(callback) {
forumThreadService.getAllCountByFid({ var conditions = {
info: fid ent_code: ent_code,
}, function(err, threadCount) { info: fid,
level: 1,
status: 1,
$or: [{
isEvent: 0
}, {
isEvent: null
}, {
isEvent: 1,
'event.eventStartTime' : {$lte : today}
}]
};
forumThreadService.getAllCountByFid(conditions, function(err, threadCount) {
if (err) { if (err) {
callback(err, null); callback(err, null);
} else { } else {
......
...@@ -212,12 +212,15 @@ exports.updateUserMessageStatus= function(condition,msgID, status,callback) { ...@@ -212,12 +212,15 @@ exports.updateUserMessageStatus= function(condition,msgID, status,callback) {
console.error(err); console.error(err);
callback(err,null); callback(err,null);
}else{ }else{
if(!msgID){ if(!msgID){ //更改全部
for(var i in docs){ for(var i = 0; i < docs.length; i++){
if (docs[i].toObject) {
docs[i] = docs[i].toObject();
}
docs[i].status = status; docs[i].status = status;
} }
} else { } else { //更改单条
for(var i in docs){ for(var i = 0; i < docs.length; i++){
if (docs[i].msg == msgID) { if (docs[i].msg == msgID) {
if (docs[i].toObject) { if (docs[i].toObject) {
docs[i] = docs[i].toObject(); docs[i] = docs[i].toObject();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment