I’m trying to create a new cron job, but it’s pretty hard to explain how to make it, and i can’t figure out how to make it. I’ll do my best to explain it.
The cron job needs to update the referred users count for all the users. The task of the cron job (it’s an SQL query) is to set the recordcount of referred users into a sql row. For example:
User A invites User B, cron job sets User A his referred count to 1 (because he referred User B), User A now invites User C, so the cron job counts +1 into his (User A) row.
After that, User B decides to invite User D, so the cronjob does his job and ads +1 into his (User B) row.
It basically comes down to check the recordcount of referred users for every user and then adding the recordcount into a row. (unique for every user, of course)
If it isn’t clear enough, tell me.
Something like this should work.
If the referrals field could be null change the WHERE clause to this: