...
|
...
|
@@ -245,17 +245,6 @@ const _detailDataPkg = (origin, uid, vipLevel, ua) => { |
|
|
consultsNum: 0
|
|
|
};
|
|
|
|
|
|
if (origin.consultBoWrapper) {
|
|
|
dest.feedbacks.consultsNum = origin.consultBoWrapper.consultTotal;
|
|
|
_.forEach(origin.consultBoWrapper.consultBoList, function(value) {
|
|
|
dest.feedbacks.consults.push({
|
|
|
question: value.ask,
|
|
|
time: value.askTime,
|
|
|
answer: value.answer
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
let consultParams = {
|
|
|
product_id: origin.id
|
|
|
};
|
...
|
...
|
@@ -608,7 +597,8 @@ let getProductData = (data) => { |
|
|
comment.getCommentInfo({
|
|
|
productId: result.id
|
|
|
}),
|
|
|
_getCommonConsult()
|
|
|
_getCommonConsult(),
|
|
|
comment.getConsults(result.id, 1, 2)
|
|
|
]).then((info) => {
|
|
|
result.promotionBoList = info[1];
|
|
|
|
...
|
...
|
@@ -617,7 +607,7 @@ let getProductData = (data) => { |
|
|
|
|
|
Object.assign(finalResult.feedbacks, info[2]);
|
|
|
|
|
|
if (!_.isEmpty(info[3]) && !_.get(info[2], 'feedbacks.consultsNum', 0)) {
|
|
|
if (!info[4].total && !_.isEmpty(info[3]) && !_.get(info[2], 'feedbacks.consultsNum', 0)) {
|
|
|
Object.assign(finalResult.feedbacks, {
|
|
|
commonConsults: true,
|
|
|
consultsNum: true,
|
...
|
...
|
@@ -625,6 +615,16 @@ let getProductData = (data) => { |
|
|
});
|
|
|
}
|
|
|
|
|
|
if (info[4]) {
|
|
|
finalResult.feedbacks.consultsNum = parseInt(info[4].total, 10);
|
|
|
|
|
|
Object.assign(finalResult.feedbacks, {
|
|
|
commonConsults: false,
|
|
|
consultsNum: parseInt(info[4].total, 10),
|
|
|
consults: _.take(info[4].list, 2)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
return finalResult;
|
|
|
});
|
|
|
|
...
|
...
|
|