1

I'm planning on writing a referral program for my recent startup. The goal is to entice the current members to recruit new members. Every member of the site will have a referral code and access to materials to help advertise the service.

When a new client signs up and pays, using a current member's referral code, the member who made the referral will receive a one-time payment (roughly 50% of what the client pays at start).

To do this, I'll add 1 field in the user profile table - to store their (generated at signup) referral code.

Then, I'll setup a referrals table to store referrals (date, referral code, new client id). At the end of each month, I'll run a report on the referral table that says who gets paid and how much. Using PayPal I'll make the payments.

Annually I'll run a report for tax purposes and then wipe the DB (to keep size low).

Does this look tight? Are there table fields/data that I didn't list, but should be using? Does it look like it would be hard to exploit this setup?

4

2 回答 2

2

不要擦除数据库。当涉及到任何涉及金钱交易的事情时,您需要记录所有内容——更新、编辑、更改、插入、删除,并且会有退款、Paypal API 失败、数据库连接不工作等等。

如果您擦除推荐数据库,则无法回溯。

于 2010-02-04T07:12:22.110 回答
0

ExtraKun 的好点子,您可能还需要它用于税收目的。

如果您想保持主数据库较小,请发布 EOY(年终)报告将数据存档在存档表中,这样您就可以提供历史查找功能(在以后需要时)。

于 2010-02-04T09:43:42.017 回答