邮件,异地登录bug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import BaseModel from './BaseModel';
|
||||
import { index, getModelForClass, prop, DocumentType, modelOptions } from '@typegoose/typegoose';
|
||||
const _ = require('underscore');
|
||||
// const Transaction = require('mongoose-transactions');
|
||||
// const Transaction = require("mongoose-transactions");
|
||||
@index({ roleId: 1, id: 1 })
|
||||
@index({ seqId: 1 })
|
||||
@modelOptions({ schemaOptions: { id: false } })
|
||||
@@ -86,14 +86,8 @@ export default class Item extends BaseModel {
|
||||
// let hasError: boolean = false, result = new Array();
|
||||
// try {
|
||||
// for (let { id, count, ratio } of items) {
|
||||
// if (ratio) ratio = -1;
|
||||
// await transaction.update({ roleId, id, count: { $gte: count } }, { $inc: { count: ratio * count } }, { new: true});
|
||||
// const rec: ItemType = await transaction.findOneAndUpdate({ roleId, id, count: { $gte: count } }, { $inc: { count: ratio * count } }, { new: true}).lean(lean);
|
||||
// if (!!rec) {
|
||||
// result.push({ id: rec.id, count: rec.count });
|
||||
// } else {
|
||||
// hasError = true; break;
|
||||
// }
|
||||
// if (!ratio) ratio = -1;
|
||||
// await transaction.update("Item", { roleId, id, count: { $gte: count } }, { $inc: { count: ratio * count } }, { new: true});
|
||||
// }
|
||||
// await transaction.run();
|
||||
// return {hasError, result};
|
||||
|
||||
Reference in New Issue
Block a user