|
@@ -0,0 +1,25 @@
|
|
|
+'use strict';
|
|
|
+const Schema = require('mongoose').Schema;
|
|
|
+const metaPlugin = require('naf-framework-mongoose/lib/model/meta-plugin');
|
|
|
+// 司机表
|
|
|
+const Zhwldriverchema = {
|
|
|
+ name: { type: String, required: true, maxLength: 200 }, // 姓名
|
|
|
+ tel: { type: String, required: true, maxLength: 200 }, // 电话/固定电话
|
|
|
+ id_card: { type: Number, required: true, maxLength: 200 }, // 身份证
|
|
|
+ drive_card: { type: String, required: true, maxLength: 200 }, // 驾驶证号
|
|
|
+ fhc_time: { type: String, required: false, maxLength: 200 }, // 初次领证时间=年月日
|
|
|
+ car_type: { type: String, required: false, maxLength: 200 }, // 准驾车型
|
|
|
+ ccu_time: { type: String, required: false, maxLength: 200 }, // 驾驶证有效日期
|
|
|
+ cc_time: { type: String, required: false, maxLength: 200 }, // 驾驶证年检日期
|
|
|
+ qc_time: { type: String, required: false, maxLength: 200 }, // 资格证年检日期
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+const schema = new Schema(Zhwldriverchema, { toJSON: { virtuals: true } });
|
|
|
+schema.index({ id: 1 });
|
|
|
+schema.plugin(metaPlugin);
|
|
|
+
|
|
|
+module.exports = app => {
|
|
|
+ const { mongoose } = app;
|
|
|
+ return mongoose.model('Zhwldriver', schema, 'zhwldriver');
|
|
|
+};
|