1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- 'use strict';
- const Schema = require('mongoose').Schema;
- const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
- // 产品图片表
- const images = new Schema({
- url: { type: String, required: true, maxLength: 500 }, // 图片路径
- });
- // 产品参数表
- const args = new Schema({
- arg_name: { type: String, required: true, maxLength: 200 }, // 参数名称
- memo: { type: String, required: true, maxLength: 200 }, // 内容
- });
- // 科技超市产品表
- const ProductSchema = {
- userid: { type: String, required: true, maxLength: 500 }, // 创建人id
- status: { type: String, required: false, maxLength: 200, default: "3" }, // 状态(0:待审核 1:通过审核 2:审核拒绝 3:草稿)
- is_del: { type: String, required: false, maxLength: 200 }, // 是否删除,0-否,1-是
- totaltype: { type: String, required: true, maxLength: 200 }, // 总分类(0.技术 1.产品 2.服务)
- is_display: { type: [String], required: false, maxLength: 2000 }, // 需要显示的字段
- name: { type: String, required: true, maxLength: 200 }, // 名称
- product_type_id: { type: String, required: false, maxLength: 200 }, // 类型id
- product_type_name: { type: String, required: false, maxLength: 200 }, // 类型名称
- introduction: { type: String, required: false }, // 简介
- phase: { type: String, required: false, maxLength: 200 }, // 研发阶段,0-阶段成果,1-最终成果
- price: { type: String, required: false, maxLength: 200 }, // 单价
- priceunit: { type: String, required: false, maxLength: 200 }, // 单位0-公斤1-套2-件
- image: { type: [images], select: true }, // 产品图片
- product_args: { type: [args], select: true }, // 产品参数
- field: { type: String, required: false, maxLength: 500 }, // 所属领域 0-先进制造1-新材料2-光电子3-信息技术4-文化和科技融合
- scope: { type: String, required: false, maxLength: 500 }, // 服务范围
- coopermode: { type: String, required: false, maxLength: 200 }, // 合作方式,0-技术转让1-技术服务2-技术许可3-技术融资4-其他
- business: { type: String, required: false, maxLength: 200 }, // 交易方式,0-公用,1-转让,2-竞价
- budget: { type: String, required: false, maxLength: 200 }, // 投入预算
- end_date: { type: String, required: false, maxLength: 200 }, // 需求截止日期
- difficult_problem: { type: String, required: false, maxLength: 500 }, // 难题及瓶颈问题
- demand: { type: String, required: false, maxLength: 500 }, // 企业解决需求
- company: { type: String, required: false, maxLength: 500 }, // 单位名称
- address: { type: String, required: false, maxLength: 500 }, // 单位地址
- team: { type: String, required: false, maxLength: 500 }, // 技术团队情况
- property: { type: String, required: false, maxLength: 500 }, // 知识产权情况
- mature: { type: String, required: false, maxLength: 200 }, // 技术成熟度 0-实验室1-小试2-中试3-成熟
- coopercompany: { type: String, required: false, maxLength: 300 }, // 合作企业
- other: { type: String, required: false, maxLength: 500 }, // 其他需求
- contact_user: { type: String, required: true, maxLength: 200 }, // 联系人
- contact_tel: { type: String, required: true, maxLength: 500 }, // 联系电话
- };
- const schema = new Schema(ProductSchema, { toJSON: { virtuals: true } });
- schema.index({ id: 1 });
- schema.plugin(metaPlugin);
- module.exports = app => {
- const { mongoose } = app;
- return mongoose.model('Product', schema, 'market_product');
- };
|