lrf 2 年之前
父节点
当前提交
6954e3adc1
共有 2 个文件被更改,包括 1 次插入16 次删除
  1. 1 1
      app/controller/shop/config/.shop.js
  2. 0 15
      app/service/trade/afterSale.js

+ 1 - 1
app/controller/shop/config/.shop.js

@@ -22,7 +22,7 @@ module.exports = {
         'meta.createdAt@start': 'meta.createdAt@start',
         'meta.createdAt@end': 'meta.createdAt@end',
         user: 'user',
-        name: 'name',
+        name: '%name%',
         code: 'code',
         person: 'person',
         phone: 'phone',

+ 0 - 15
app/service/trade/afterSale.js

@@ -23,21 +23,6 @@ class AfterSaleService extends CrudService {
     // 查看该商品是否已经申请售后
     const hasData = await this.model.count({ order_detail, 'goods._id': goods_id, type: [ '0', '1', '2', '3' ] });
     if (hasData > 0) throw new BusinessError(ErrorCode.DATA_EXISTED, '该商品已有正在处理中的售后申请.请勿重复申请');
-
-    // 查询该商品是不是申请退款,如果是申请退款,查看是否有记录,如果有记录,是否已经退款
-    // const type = _.get(others, 'type');
-    // if (type === '0') {
-    //   const record = await this.model.find({ order_detail, 'goods._id': goods_id, type: '0' });
-    //   if (record) {
-    //     const rs = _.get(record, 'status');
-    //     if (rs === '0' || rs === '1') throw new BusinessError(ErrorCode.DATA_EXISTED, '已申请退款,正在等待处理');
-    //     else if (rs === '-1') throw new BusinessError(ErrorCode.DATA_EXISTED, '该商品已退款');
-    //   }
-    // } else {
-    //   // 如果是换货/维修,那么可以重复多次,也就是需要查当前该货物是否有未结束的售后,如果有,则不能添加
-    //   const num = await this.model.count({ order_detail, 'goods._id': goods_id, type, status: [ '2', '3' ] });
-    //   if (num) throw new BusinessError(ErrorCode.DATA_INVALID, '商品正在售后中');
-    // }
     const { goods: goodsList } = orderDetail;
     const goods = goodsList.find(f => ObjectId(f._id).equals(goods_id));
     if (!goods) throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '未在当前订单中搜索到要售后的商品');