guhongwei пре 4 година
родитељ
комит
99a3fdef74
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      app/model/dock.js

+ 7 - 2
app/model/dock.js

@@ -2,13 +2,17 @@
 const Schema = require('mongoose').Schema;
 const Schema = require('mongoose').Schema;
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
 const { Secret } = require('naf-framework-mongoose/lib/model/schema');
 const { Secret } = require('naf-framework-mongoose/lib/model/schema');
+// 产品图片表
+const images = new Schema({
+  url: { type: String, required: true, maxLength: 500 }, // 图片路径
+});
 // const image = new Schema({
 // const image = new Schema({
 // });
 // });
 // image.index({ id: 1 });
 // image.index({ id: 1 });
 // 产品
 // 产品
 const goods = new Schema({
 const goods = new Schema({
   userid: { type: String, required: false, maxLength: 500 }, // 创建人id
   userid: { type: String, required: false, maxLength: 500 }, // 创建人id
-  status: { type: String, required: false, maxLength: 200, default: '3' }, // 状态(0:待审核 1:通过审核 2:审核拒绝 3:草稿)
+  status: { type: String, required: false, maxLength: 200, default: "3" }, // 状态(0:待审核 1:通过审核 2:审核拒绝 3:草稿)
   is_del: { type: String, required: false, maxLength: 200 }, // 是否删除,0-否,1-是
   is_del: { type: String, required: false, maxLength: 200 }, // 是否删除,0-否,1-是
   type: { type: String, required: false, maxLength: 200 }, // 类型: 0-技术;1-成果;2-服务
   type: { type: String, required: false, maxLength: 200 }, // 类型: 0-技术;1-成果;2-服务
   name: { type: String, required: false, maxLength: 200 }, // 名称
   name: { type: String, required: false, maxLength: 200 }, // 名称
@@ -51,7 +55,8 @@ const goods = new Schema({
   companybrief: { type: String, required: false }, // 企业简介
   companybrief: { type: String, required: false }, // 企业简介
   companyweb: { type: String, required: false, maxLength: 2000 }, // 企业网站
   companyweb: { type: String, required: false, maxLength: 2000 }, // 企业网站
   condition: { type: String, required: false, maxLength: 300 }, // 合作条件及要求
   condition: { type: String, required: false, maxLength: 300 }, // 合作条件及要求
-  image: { type: [ String ], required: false, maxLength: 200 }, // 图片
+  // image: { type: [ String ], required: false, maxLength: 200 }, // 图片
+  image: { type: [images], select: true }, // 图片
   // 商务方面字段
   // 商务方面字段
   messattribute: { type: String, required: false, maxLength: 200 }, // 信息属性
   messattribute: { type: String, required: false, maxLength: 200 }, // 信息属性
   demand: { type: String, required: false, maxLength: 200 }, // 需求程度
   demand: { type: String, required: false, maxLength: 200 }, // 需求程度