Sfoglia il codice sorgente

Merge branch 'patent' of http://git.cc-lotus.info/live/service-live into patent

lrf 3 anni fa
parent
commit
678cf06135

+ 1 - 1
app/controller/users/.personal.js

@@ -56,7 +56,7 @@ module.exports = {
   index: {
     parameters: {
       query: {
-        name: '%name%',
+        name: 'name',
         phone: 'phone',
         code: 'code',
         juris: 'juris',

+ 1 - 1
app/model/personal.js

@@ -37,7 +37,7 @@ schema.index({ juris: 1 });
 schema.index({ profession: 1 });
 schema.index({ 'meta.createdAt': 1 });
 schema.plugin(metaPlugin);
-module.exports = (app) => {
+module.exports = app => {
   const { mongoose } = app;
   return mongoose.model('Personal', schema, 'personal');
 };

+ 5 - 2
app/service/patent/patentearly.js

@@ -92,14 +92,17 @@ class PatentearlyService extends CrudService {
       const start = moment(nowDate).subtract(limitMonth, 'months').format('YYYY-MM-DD');
       // 结束时间
       const end = afterYear + '-' + month;
+      const endbeforeone = moment(end).subtract(1, 'd').format('YYYY-MM-DD');
       const r = moment().isBetween(start, end, null, '[]');
-      console.log(r);
       if (r) {
         total++;
         // 2021-11-08 第一天/最后一天/相差天数被10整出的天数(并不算是严格的每隔10天) 发送消息
         // 是否发送的变量
         let dr = false;
-        if (moment().format('YYYY-MM-DD') === start || moment().format('YYYY-MM-DD') === end) {
+        if (
+          moment().format('YYYY-MM-DD') === start ||
+          moment().format('YYYY-MM-DD') === endbeforeone
+        ) {
           // 第一天/最后一天发送
           dr = true;
         } else {

+ 4 - 1
app/service/statistics/index.js

@@ -382,6 +382,9 @@ class IndexService extends CrudService {
     const patentExamine = this.ctx.model.Patent.Patentexamine;
     // 未读消息
     const unread = await patentExamine.count({ to: id, is_read: false });
+    // 通知信息
+    const patentNotice = this.ctx.model.Patent.Patentnotice;
+    const notice = await patentNotice.count({ to_id: id, to_type: '4', is_read: false });
     // 专利申请
     const papply = this.ctx.model.Patent.Patentapply;
     const apply = await papply.count({
@@ -411,7 +414,7 @@ class IndexService extends CrudService {
     const trans4 = await patentTrans.count({ type: '招商', user_id: id });
     const trans5 = await patentTrans.count({ type: '质押', user_id: id });
     return {
-      message: { unread },
+      message: { unread, notice },
       apply: { apply, analysis, access },
       patent: { information, safeg, early },
       transaction: { trans1, trans2, trans3, trans4, trans5 },