Contest reward cron
===================

Added files:
- application/controllers/Cron.php
- application/models/M_contest.php

What it does now:
- Processes MULTIPLE contest types in one cron run.
- Daily contest:
  - daily_activity
- Monthly contests:
  - monthly_offerwall
  - monthly_referral
- Prevents double-crediting by storing a processing log in contest_reward_log.
- Automatically creates contest_reward_log if it does not already exist.
- Safe to run every day because each contest period is only paid once.

Important notes:
- monthly_offerwall is configured from the current app reward array, which is all zeros.
  That means it will be checked, but skipped until you set positive rewards in Cron.php.
- No weekly reward logic was found in the uploaded project, so weekly contests are not paid.

Configured rewards:
- daily_activity:
  1: 8000
  2: 5000
  3: 3000
  4: 2000
  5: 1500
  6: 1000
  7: 900
  8: 800
  9: 700
  10: 500
  11: 500
  12: 500
  13: 500
  14: 500
  15: 300
  16: 300
  17: 300

- monthly_offerwall:
  1: 0
  2: 0
  3: 0
  4: 0
  5: 0

- monthly_referral:
  1: 5000000
  2: 2000000
  3: 1000000
  4: 600000
  5: 400000

How periods are chosen:
- daily contests use the previous completed day.
- monthly contests use the previous completed calendar month.

Cron command:
php /path/to/project/index.php cron/contest_rewards

This single command checks all configured contests.

Useful commands:
- Dry run:
  php /path/to/project/index.php cron/contest_rewards "" 1

- Use a specific anchor date:
  php /path/to/project/index.php cron/contest_rewards 2026-04-17

Anchor date behavior:
- daily_activity uses the day before the anchor date.
- monthly contests use the month before the anchor date.

Suggested cron (runs every day at 00:10):
10 0 * * * /usr/bin/php /path/to/project/index.php cron/contest_rewards >> /path/to/project/application/logs/contest_rewards.log 2>&1

Notes:
- This endpoint is CLI-only for safety.
- If the same contest period is processed again, it will skip and not pay twice.
