|
|
|
@ -252,12 +252,14 @@ var async = require('async'),
|
|
|
|
|
Categories.getMultipleCategoryFields(cids, ['parentCid'], function(err, data) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return callback(err);
|
|
|
|
|
} else if (!data.hasOwnProperty('parentCid')) {
|
|
|
|
|
data.parentCid = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var parentCids = data.map(function(category) {
|
|
|
|
|
return category && category.parentCid;
|
|
|
|
|
if (category && category.hasOwnProperty('parentCid') && category.parentCid) {
|
|
|
|
|
return category.parentCid;
|
|
|
|
|
} else {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Categories.getCategoriesData(parentCids, callback);
|
|
|
|
|