Commit c02906a1 authored by strong's avatar strong

Merge commit '528f8843'

parents 5eaf6846 528f8843
......@@ -32,8 +32,8 @@ var ForumAboutMeSchema = new Schema({
index: true,
ref: 'ForumThread',
require:true
},
threadStatus:{
},
threadStatus:{ //0屏蔽 1.正常, 2删除
type: Number
},
commentLevel1:{//一级评论
......@@ -48,7 +48,7 @@ var ForumAboutMeSchema = new Schema({
index: true,
ref: 'ForumUser'
},
commentLevel1Status:{
commentLevel1Status:{ //0屏蔽 1.正常, 2删除
type: Number
},
commentLevel2:{//二级评论
......
......@@ -297,7 +297,6 @@ exports.saveCommentLevel2BySearch=function(tid,l1id,l2id){
exports.updateThreadStatus=function(tid,status){
var condition={
type:THREAD_TYPE,
thread:new mongoose.Types.ObjectId(tid),
threadStatus:{$ne:status}
}
......@@ -321,7 +320,6 @@ exports.updateThreadStatus=function(tid,status){
exports.updateCommentLevel1Status=function(cid,status){
var condition={
type:COMMENTLEVEL1_TYPE,
commentLevel1:new mongoose.Types.ObjectId(cid),
commentLevel1Status:{$ne:status}
}
......@@ -345,7 +343,6 @@ exports.updateCommentLevel1Status=function(cid,status){
exports.updateCommentLevel2Status=function(cid,status){
var condition={
type:COMMENTLEVEL2_TYPE,
commentLevel2:new mongoose.Types.ObjectId(cid),
commentLevel2Status:{$ne:status}
}
......@@ -371,12 +368,20 @@ exports.me2other=function(ent_code,id,pageNo,pageSize,callback){
var condition={
ent_code:ent_code,
from:new mongoose.Types.ObjectId(id),
// $or:[{
// type:THREAD_TYPE,threadStatus:1
// },{
// type:COMMENTLEVEL1_TYPE,threadStatus:1,commentLevel1Status:1
// },{
// type:COMMENTLEVEL2_TYPE,threadStatus:1,commentLevel1Status:1,commentLevel2Status:1
// }]
$or:[{
type:THREAD_TYPE,threadStatus:1
},{
type:COMMENTLEVEL1_TYPE,threadStatus:1,commentLevel1Status:1
type:COMMENTLEVEL1_TYPE,threadStatus:1
},{
type:COMMENTLEVEL2_TYPE,threadStatus:1,commentLevel1Status:1,commentLevel2Status:1
type:COMMENTLEVEL2_TYPE,threadStatus:1,commentLevel1Status:1
}]
};
......@@ -418,10 +423,16 @@ exports.other2me=function(ent_code,id,pageNo,pageSize,callback){
var condition={
ent_code:ent_code,
to:new mongoose.Types.ObjectId(id),
// $or:[{
// type:COMMENTLEVEL1_TYPE,threadStatus:1,commentLevel1Status:1
// },{
// type:COMMENTLEVEL2_TYPE,threadStatus:1,commentLevel1Status:1,commentLevel2Status:1
// }]
$or:[{
type:COMMENTLEVEL1_TYPE,threadStatus:1,commentLevel1Status:1
type:COMMENTLEVEL1_TYPE,threadStatus:1
},{
type:COMMENTLEVEL2_TYPE,threadStatus:1,commentLevel1Status:1,commentLevel2Status:1
type:COMMENTLEVEL2_TYPE,threadStatus:1,commentLevel1Status:1
}]
};
ForumAboutMe.find(condition).count(function(err,count){
......
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