lrf 2 年之前
父节点
当前提交
b1681c66f6
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      app/service/shop/shopNotice.js

+ 2 - 0
app/service/shop/shopNotice.js

@@ -24,12 +24,14 @@ class ShopNoticeService extends CrudService {
     const list = [];
     if (_.isString(source_id)) {
       const od = await this.orderDetailModel.findById(source_id);
+      if (!od) return;
       const content = this.toSendMsg(_.get(od, 'no'));
       const obj = { shop: _.get(od, 'shop'), source: '1', source_id, time: moment().format('YYYY-MM-DD HH:mm:ss'), content, type };
       list.push(obj);
     } else if (_.isArray(source_id)) {
       for (const id of source_id) {
         const od = await this.orderDetailModel.findById(id);
+        if (!od) continue;
         const content = this.toSendMsg(_.get(od, 'no'));
         const obj = { shop: _.get(od, 'shop'), source: '1', source_id: id, time: moment().format('YYYY-MM-DD HH:mm:ss'), content, type };
         list.push(obj);