|
@@ -89,6 +89,16 @@ class OrderDetailService extends CrudService {
|
|
res = await this.afterFetch(filter, res);
|
|
res = await this.afterFetch(filter, res);
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ async afterQuery(filter, data) {
|
|
|
|
+ data = JSON.parse(JSON.stringify(data));
|
|
|
|
+ for (const i of data) {
|
|
|
|
+ const { goods } = i;
|
|
|
|
+ const buy_num_total = goods.reduce((p, n) => this.ctx.plus(p, n.buy_num), 0);
|
|
|
|
+ i.buy_num_total = buy_num_total;
|
|
|
|
+ }
|
|
|
|
+ return data;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
module.exports = OrderDetailService;
|
|
module.exports = OrderDetailService;
|