companysearch.js 950 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const Schema = require('mongoose').Schema;
  3. const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
  4. // 企业查询信息表
  5. const CompanysearchSchema = {
  6. userid: { type: String, required: false, maxLength: 200 }, // 关联企业用户id
  7. company_name: { type: String, required: false, maxLength: 200 }, // 企业名称
  8. searchinfo: { type: String, select: true }, // 查询条件
  9. create_time: { type: String, required: false, maxLength: 20 }, // 查询时间
  10. result_info: { type: String, required: false }, // 查询结果
  11. type: { type: String, required: false, maxLength: 20 }, // 认证状态,0-债权,1-股权
  12. };
  13. const schema = new Schema(CompanysearchSchema, { toJSON: { virtuals: true } });
  14. schema.index({ id: 1 });
  15. schema.index({ uid: 1 });
  16. schema.plugin(metaPlugin);
  17. module.exports = app => {
  18. const { mongoose } = app;
  19. return mongoose.model('Companysearch', schema, 'company_search');
  20. };