lrf 2 lat temu
rodzic
commit
5b30b890ce

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

@@ -27,6 +27,7 @@ module.exports = {
         time: 'time',
         type: 'type',
         status: 'status',
+        source_type: 'source_type',
       },
       // options: {
       //   "meta.state": 0 // 默认条件

+ 4 - 4
app/service/shop/shopNotice.js

@@ -26,14 +26,14 @@ class ShopNoticeService extends CrudService {
       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 };
+      const obj = { shop: _.get(od, 'shop'), source: '1', source_id, time: moment().format('YYYY-MM-DD HH:mm:ss'), content, type, source_type: '0' };
       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 };
+        const obj = { shop: _.get(od, 'shop'), source: '1', source_id: id, time: moment().format('YYYY-MM-DD HH:mm:ss'), content, type, source_type: '0' };
         list.push(obj);
       }
     }
@@ -60,14 +60,14 @@ class ShopNoticeService extends CrudService {
       const data = await this.afterSaleModel.findById(source_id);
       const od = await this.orderDetailModel.findById(data.order_detail);
       const content = this.toAfterSaleMsg(_.get(od, 'no'));
-      const obj = { shop: _.get(data, 'shop'), source: '1', source_id, time: moment().format('YYYY-MM-DD HH:mm:ss'), content, type };
+      const obj = { shop: _.get(data, 'shop'), source: '1', source_id, time: moment().format('YYYY-MM-DD HH:mm:ss'), content, type, source_type: '1' };
       list.push(obj);
     } else if (_.isArray(source_id)) {
       for (const id of source_id) {
         const data = await this.afterSaleModel.findById(id);
         const od = await this.orderDetailModel.findById(data.order_detail);
         const content = this.toAfterSaleMsg(_.get(od, 'no'));
-        const obj = { shop: _.get(data, 'shop'), source: '1', source_id: id, time: moment().format('YYYY-MM-DD HH:mm:ss'), content, type };
+        const obj = { shop: _.get(data, 'shop'), source: '1', source_id: id, time: moment().format('YYYY-MM-DD HH:mm:ss'), content, type, source_type: '1' };
         list.push(obj);
       }
     }