This is a repaired full-open-source Lucky Draw number-data platform built on ThinkPHP 3 with PHP 5.6β7.x and MySQL 5.5+, covering 4 frontends: mobile, PC, agent panel, and master admin backend. It ships with one draw type (Lucky Five), a fixed-number play module for the Hainan region, and an OA credit-ledger settlement system. It suits developers who need a complete legacy PHP project for learning, secondary development, or private deployment β the source code download package on dajian168 includes all four ends and the polling script.
Honest note up front: this codebase is roughly a decade old. The seller repaired most of the broken pieces, and in my local test it runs end-to-end, but a few bugs remain. If you expect Laravel-era code quality, you’ll be disappointed. If you want a working TP3 reference project with a settlement flow already wired, it’s a solid base.
The whole deployment hinges on one .env file β you set the main domain, the 4 sub-domains (mobile/PC/admin/agent), and DB credentials there, nothing else. That’s a big time-saver compared to typical old TP3 projects where config is scattered across 5β6 files.
php local-draw.php, runs every 5 seconds via cronWhen I deployed this, the only real gotcha was the rewrite rule. Nginx needs this exact block or every non-index route 404s:
location / {
try_files $uri $uri/ /index.php?s=$uri&$args;
}
Takeaway: copy that pseudo-static rule verbatim into your server block before testing anything else β 90% of “blank page” complaints on TP3 projects are rewrite issues, not code bugs.
Local testing took me under 30 minutes with the steps below; budget about an hour if you’re also configuring SSL for the 4 domains.
/public if your build includes one, otherwise the root..env: main domain, 4 end-domain values, DB host/user/password.*/5 * * * * * php /path/local-draw.php for the 5-second settlement loop (adjust to your cron granularity β many panels only support 1-minute minimums, so use a while-loop wrapper or supervisord).Takeaway: cron granularity is the pitfall here. The script is designed for 5-second execution, but standard cron can’t do that β use a shell loop or supervisor process, or settlement will lag behind draws.
Testing surfaced roughly 80% feature completeness β the core draw, settlement, and 4-end access all function, but I found unfixed edge bugs in the ledger reconciliation and some agent-level report pages. Treat this as a development base, not production-ready software.
| Item | Status | Note |
|---|---|---|
| Core draw flow | Working | Random polling; official feed optional |
| Settlement (local-draw.php) | Working | 5s cycle, needs loop wrapper |
| Agent panel | Mostly working | Some report pages buggy |
| OA credit ledger | Partially repaired | Audit the reconciliation logic |
Takeaway: before any real use, run a checklist β trace one full settlement cycle manually, verify agent balance math against the DB, and grep for hardcoded old domains left over from the original build.
Q: Which PHP version should I run this on?
TP3 is happiest on PHP 5.6β7.2. On PHP 7.4+ you may hit deprecated function warnings; patch them or downgrade.
Q: Can I connect official data polling instead of the built-in random generator?
Yes. The polling module is a separate layer β replace the random-data source with your official feed endpoint and keep the 5-second local-draw.php cycle unchanged.
Q: Does the package include all 4 frontends?
Yes β mobile H5, PC, master admin, and agent panel, all open source, all configured through the single .env file.







β οΈ This article is for educational research and technical exchange only. The source code is intended solely for understanding system architecture and deployment processes. Do not use it for illegal purposes. Any commercial operation is unrelated to the author.