瀏覽代碼

添加cms 查询条件

asd123a20 2 年之前
父節點
當前提交
cec6efe9a8
共有 1 個文件被更改,包括 2 次插入1 次删除
  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;