|
@@ -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);
|