|
@@ -129,6 +129,17 @@ class AfterSaleService extends CrudService {
|
|
|
// 修改订单详情的优惠券标记
|
|
|
tran.update('OrderDetail', orderDetail._id, { 'total_detail.discount_detail': discount_detail });
|
|
|
}
|
|
|
+
|
|
|
+ async fetch(filter) {
|
|
|
+ assert(filter);
|
|
|
+ filter = await this.beforeFetch(filter);
|
|
|
+ const { _id, id } = filter;
|
|
|
+ if (_id || id) filter = { _id: ObjectId(_id || id) };
|
|
|
+ const { populate } = this.getRefMods();
|
|
|
+ let res = await this.model.findOne(filter).populate(populate).exec();
|
|
|
+ res = await this.afterFetch(filter, res);
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
module.exports = AfterSaleService;
|