Browse Source

添加cms 查询条件

asd123a20 2 years ago
parent
commit
cec6efe9a8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      service-cms/app/service/content.js

+ 2 - 1
service-cms/app/service/content.js

@@ -46,7 +46,7 @@ class ContentService extends Service {
       throw error;
     }
   }
-  async query({ skip, limit, title, date, bind, keywords, svip, isShow, status, istop, parentCode }) {
+  async query({ skip, limit, title, date, bind, keywords, svip, isShow, status, istop, parentCode, recommend }) {
     if (parentCode) {
       const menus = await this.service.menu.menuList({ code: parentCode });
       const filter = { bind: { $in: menus } };
@@ -72,6 +72,7 @@ class ContentService extends Service {
         filter.$or.push(JSON.parse(datas));
       }
     }
+    if (recommend) filter.recommend = recommend;
     if (bind) filter.bind = bind;
     try {
       let res;