日志:修复玩家日志记录
This commit is contained in:
@@ -34,8 +34,10 @@ export async function saveLoginAndOutLog(type: LOG_TYPE, session: any) {
|
||||
|
||||
export async function saveCeChangeLog(role: RoleType, inc: number, count: number, type: number, ids: number[]) {
|
||||
try {
|
||||
let params = getParamByRole(role);
|
||||
await UserLogModel.createRecord({ type: LOG_TYPE.CE_CHANGE, ...params, inc, count, ceChangeReason: type, ceChangeIds: ids });
|
||||
if(inc != 0) {
|
||||
let params = getParamByRole(role);
|
||||
await UserLogModel.createRecord({ type: LOG_TYPE.CE_CHANGE, ...params, inc, count, ceChangeReason: type, ceChangeIds: ids });
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
@@ -67,6 +69,7 @@ export async function saveItemChangeLog(roleId: string, goods: { id: number, cou
|
||||
let role = await RoleModel.findByRoleId(roleId, 'userInfo roleId roleName serverId');
|
||||
let params = getParamByRole(role);
|
||||
for (let { id, count, inc } of goods) {
|
||||
if(inc == 0) continue;
|
||||
let dicGoods = gameData.goods.get(id);
|
||||
await UserLogModel.createRecord({ type: LOG_TYPE.ITEM_CHANGE, ...params, itemId: id, itemName: dicGoods.name, itid: dicGoods.itid, inc, count, itemChangeReason: reason })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user