perf: promotion

This commit is contained in:
archer
2023-07-20 19:22:23 +08:00
parent 6d358ef3e6
commit 9fefaa8e18
7 changed files with 51 additions and 244 deletions

View File

@@ -1,36 +0,0 @@
import { promotionRecord } from '../mongo';
export const pushPromotionRecord = async ({
userId,
objUId,
type,
amount
}: {
userId: string;
objUId: string;
type: 'invite' | 'shareModel';
amount: number;
}) => {
try {
await promotionRecord.create({
userId,
objUId,
type,
amount
});
} catch (error) {
console.log('创建推广记录异常', error);
}
};
export const withdrawRecord = async ({ userId, amount }: { userId: string; amount: number }) => {
try {
await promotionRecord.create({
userId,
type: 'withdraw',
amount
});
} catch (error) {
console.log('提现记录异常', error);
}
};