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) {
router.get('/info/:fid/get', function(req, res, next) {
var fid = req.params.fid || null;
if (fid) {
var ent_code = req.session.user.ent_code;
var today = new Date();
var source = req.session.mobileForumUser.source;
httpService.createLog(req, source, fid, 2);
forumInfoService.updateInfoPvCount(fid, function(err, result) {
......@@ -82,9 +84,22 @@ router.get('/info/:fid/get', function(req, res, next) {
});
},
function(callback) {
forumThreadService.getAllCountByFid({
info: fid
}, function(err, threadCount) {
var conditions = {
ent_code: ent_code,
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) {
callback(err, null);
} else {
......
......@@ -212,12 +212,15 @@ exports.updateUserMessageStatus= function(condition,msgID, status,callback) {
console.error(err);
callback(err,null);
}else{
if(!msgID){
for(var i in docs){
if(!msgID){ //更改全部
for(var i = 0; i < docs.length; i++){
if (docs[i].toObject) {
docs[i] = docs[i].toObject();
}
docs[i].status = status;
}
} else {
for(var i in docs){
} else { //更改单条
for(var i = 0; i < docs.length; i++){
if (docs[i].msg == msgID) {
if (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