This commit is contained in:
chaosBreaking
2019-10-12 11:50:57 +08:00
parent 5601223085
commit 0bb94f6bc7
7 changed files with 261 additions and 7 deletions

View File

@@ -0,0 +1,47 @@
'use strict';
const mongoose = require('mongoose');
// 实名认证工单
const VreqSchema = new mongoose.Schema({
userId: {
type: String,
},
verifyLevel: {
type: Number,
default: 1
},
status: {
type: Number,
default: 0
},
data: {
type: {}
},
info: {
type: String,
default: '审核中'
},
option: {
type: {}
}
},{
timestamps: {}
});
const VreqModel = mongoose.model('Vreq', VreqSchema);
/**
* status: created -> processing -> finished
*/
VreqModel.prototype.next = async function (handler = '') {
// handler 表示处理人
if (+this.status === 1) return this;
if (this.status === 0) {
await this.update({
status: 'processing',
handler
});
}
return this;
};
module.exports = VreqModel;