明树Git Lab

Commit 06325b1e authored by zengfanpei's avatar zengfanpei

update

parent 2efffc91
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const moment = require('moment');
/**
* 农事预警 根据生长周期 写定时脚本 每日检查 生成通知及预警信息
*/
const AgrTaskSchema = new Schema({
zone: {
type: mongoose.Types.ObjectId,
},
land: {
type: mongoose.Types.ObjectId,
},
createdAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
updatedAt: {
type: Date,
default: Date.now,
get: v => moment(v).format("YYYY-MM-DD HH:mm:ss"),
},
del: {
type: Number,
default: 0,
comment: '默认0 , 1:表示删除,若有其他隐藏业务 不要混用此字段。'
}
}, {
toJSON: {
getters: true
}
});
const AgrTask = mongoose.model('AgrTask', AgrTaskSchema, 'letianAgrTask');
module.exports = AgrTask;
\ No newline at end of file
...@@ -18,6 +18,10 @@ const PlantCycleSchema = new Schema({ ...@@ -18,6 +18,10 @@ const PlantCycleSchema = new Schema({
type: Date, type: Date,
}, },
content: {
type: String,
comment: "内容 : 注意事项"
},
createdAt: { createdAt: {
......
...@@ -57,7 +57,9 @@ const userSchema = new Schema({ ...@@ -57,7 +57,9 @@ const userSchema = new Schema({
avatar: { avatar: {
type: mongoose.Types.ObjectId, type: mongoose.Types.ObjectId,
ref: 'File', ref: 'File',
comment: "头像文件" comment: "头像文件",
default: null,
set: v => {if(!v) {return null;} else {return v;}}
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment