v1.18.x
barisusakli 10 years ago
parent 035c32df66
commit feed33f6e2

@ -435,10 +435,10 @@ var db = require('./database'),
db.incrObjectField('category:' + cid, 'post_count', next);
},
function(next) {
if(parseInt(topicData.pinned, 10) === 0) {
db.sortedSetAdd('categories:' + cid + ':tid', postData.timestamp, postData.tid, next);
} else {
if (parseInt(topicData.pinned, 10) === 1) {
next();
} else {
db.sortedSetAdd('categories:' + cid + ':tid', postData.timestamp, postData.tid, next);
}
}
], callback);

@ -87,7 +87,7 @@ module.exports = function(db, module) {
item = item || {};
var result = {};
for(i=0; i<fields.length; ++i) {
result[fields[i]] = item[fields[i]] || null;
result[fields[i]] = item[fields[i]] !== undefined ? item[fields[i]] : null;
}
callback(null, result);
});

Loading…
Cancel
Save