浏览代码

栏目修改

nihao 5 年之前
父节点
当前提交
e5bf363c49
共有 3 个文件被更改,包括 17 次插入1 次删除
  1. 1 0
      .gitignore
  2. 1 1
      app/controller/.column.js
  3. 15 0
      app/service/column.js

+ 1 - 0
.gitignore

@@ -12,3 +12,4 @@ run/
 *.un~
 .travis.yml
 appveyor.yml
+.history

+ 1 - 1
app/controller/.column.js

@@ -59,7 +59,7 @@ module.exports = {
   // 前台加载栏目列表
   "list": {
     "parameters": {
-      "query": ["!site", "parent_id", "is_use"],
+      "query": ["!site", "parent_id", "is_use","parent_type"],
       "options": {
         "meta.state": 0, // 只显示未删除数据
       },

+ 15 - 0
app/service/column.js

@@ -87,6 +87,21 @@ class ColumnService extends CrudService {
   async restore({ id }) {
     return await this.status({ id, state: 0 });
   }
+  // async querys(filter, options){
+  //   const {site, parent_id, is_use, parent_type } = filter;
+  //   assert(_.isString(site), 'site不能为空');
+  //   assert(!parent_id || _.isString(parent_id), 'parent_id必须为字符串');
+  //   assert(!is_use || _.isString(is_use), 'is_use必须为字符串');
+  //   assert(!parent_type || _.isString(parent_type), 'parent_type必须为字符串');
+  //   const data = {
+  //     site, parent_id, is_use, parent_type: { $ne: "column" }
+  //   };
+  //   if (parent_type === null || parent_type === undefined){
+  //     return await this.model.list(data);
+  //   }else{
+  //     return await this.model.list(filter);
+  //   }
+  // }
 }
 
 module.exports = ColumnService;