物品增加掉落
This commit is contained in:
+2
-2
@@ -44,8 +44,8 @@ export default class Item extends BaseModel {
|
||||
public static async increaseItem(roleId: string, id: number, count: number, itemInfo: {roleId: string, roleName: string, id: number, itemName: string, type: number, hid?: number }, lean = true) {
|
||||
const doc = new ItemModel();
|
||||
const setOnInsert = Object.assign(doc.toJSON(), itemInfo);
|
||||
const equips: ItemType = await ItemModel.findOneAndUpdate({roleId, id },{$setOnInsert: setOnInsert, $inc: { count }}, {new: true, upsert: true}).lean(lean);
|
||||
return equips;
|
||||
const items = await ItemModel.findOneAndUpdate({roleId, id },{$setOnInsert: setOnInsert, $inc: { count }}, {new: true, upsert: true}).lean(lean);
|
||||
return items;
|
||||
}
|
||||
|
||||
public static async decreaseItems(roleId: string, items: Array<{id: number, count: number}>, lean = true) {
|
||||
|
||||
Reference in New Issue
Block a user