diff --git a/DEPLOY.md b/DEPLOY.md index 446b577..cd958ef 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -3,7 +3,7 @@ 1. **Upload Files**: Upload all files to your server (e.g., via BT Panel/宝塔). 2. **Database Setup**: - Create a new MySQL/MariaDB database. - - Import `install.sql` into the new database. + - Import `database_full.sql` into the new database. 3. **Configuration**: - Edit `db/config.php` and update the `DB_NAME`, `DB_USER`, and `DB_PASS` with your new database credentials. 4. **Permissions**: Ensure the `uploads/` and `db/` directories are writable by the web server. diff --git a/database_full.sql b/database_full.sql index 6770c1a..bb2ada3 100644 --- a/database_full.sql +++ b/database_full.sql @@ -1,15 +1,28 @@ --- -------------------------------------------------------- --- 完整数据库备份与安装脚本 (V2 - 包含所有业务表) --- 适用环境:宝塔面板 / PHP + MySQL --- -------------------------------------------------------- +/*M!999999\- enable the sandbox mode */ +-- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64) +-- +-- Host: 127.0.0.1 Database: app_38451 +-- ------------------------------------------------------ +-- Server version 10.11.14-MariaDB-0+deb12u2 -SET NAMES utf8mb4; -SET FOREIGN_KEY_CHECKS = 0; +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `admins` +-- --- ---------------------------- --- Table structure for admins --- ---------------------------- DROP TABLE IF EXISTS `admins`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; CREATE TABLE `admins` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, @@ -21,13 +34,469 @@ CREATE TABLE `admins` ( PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO `admins` VALUES (1, 'admin', '$2y$10$uJvcqHNb.naRWj.apBapi.C.fF2zaIbMhYEtVdGmmVUWZkQi9ESfe', 'admin', '2026-02-18 03:07:35', 0, NULL); +-- +-- Dumping data for table `admins` +-- + +LOCK TABLES `admins` WRITE; +/*!40000 ALTER TABLE `admins` DISABLE KEYS */; +INSERT INTO `admins` VALUES +(1,'admin','$2y$10$uJvcqHNb.naRWj.apBapi.C.fF2zaIbMhYEtVdGmmVUWZkQi9ESfe','admin','2026-02-18 03:07:35',0,NULL); +/*!40000 ALTER TABLE `admins` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `binary_orders` +-- + +DROP TABLE IF EXISTS `binary_orders`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `binary_orders` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `symbol` varchar(20) NOT NULL, + `direction` varchar(10) DEFAULT NULL, + `amount` decimal(20,8) NOT NULL, + `duration` int(11) NOT NULL, + `profit_rate` decimal(5,2) NOT NULL, + `entry_price` decimal(20,8) NOT NULL, + `close_price` decimal(20,8) DEFAULT NULL, + `status` enum('pending','won','lost','cancelled') DEFAULT 'pending', + `control_status` tinyint(4) DEFAULT 0 COMMENT '0: normal, 1: force win, 2: force loss', + `created_at` timestamp NULL DEFAULT current_timestamp(), + `end_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `binary_orders` +-- + +LOCK TABLES `binary_orders` WRITE; +/*!40000 ALTER TABLE `binary_orders` DISABLE KEYS */; +INSERT INTO `binary_orders` VALUES +(1,2,'BTC','up',100.00000000,60,8.00,67652.01000000,68328.53010000,'won',1,'2026-02-18 06:00:25','2026-02-18 08:00:59'), +(2,2,'BTC','down',100.00000000,60,8.00,67788.80000000,67110.91200000,'won',1,'2026-02-18 06:16:43','2026-02-18 08:00:59'), +(3,2,'BTC','up',1000.00000000,60,8.00,67879.37000000,68558.16370000,'won',1,'2026-02-18 06:40:10','2026-02-18 08:00:59'), +(4,2,'BTC','up',500.00000000,60,8.00,67839.92000000,68518.31920000,'won',1,'2026-02-18 06:57:02','2026-02-18 08:00:59'), +(5,2,'BTC','up',100.00000000,60,8.00,67813.14000000,68491.27140000,'won',1,'2026-02-18 07:07:26','2026-02-18 08:00:59'), +(6,2,'BTC','down',100.00000000,60,8.00,67770.32000000,67092.61680000,'won',1,'2026-02-18 07:17:26','2026-02-18 08:00:59'), +(7,2,'BTC','down',100.00000000,60,8.00,67753.40000000,67075.86600000,'won',1,'2026-02-18 07:22:09','2026-02-18 08:00:59'), +(8,2,'BTC','up',100.00000000,60,8.00,67756.31000000,68433.87310000,'won',1,'2026-02-18 07:27:16','2026-02-18 08:01:00'), +(9,2,'BTC','down',100.00000000,60,8.00,67798.67000000,67120.68330000,'won',1,'2026-02-18 07:33:08','2026-02-18 08:01:00'), +(10,2,'BTC','down',100.00000000,60,8.00,68073.40000000,67392.66600000,'won',1,'2026-02-18 07:44:11','2026-02-18 08:01:00'), +(11,2,'BTC','up',100.00000000,60,8.00,68158.35000000,68839.93350000,'won',1,'2026-02-18 07:50:39','2026-02-18 08:01:00'), +(12,2,'BTC','up',100.00000000,60,8.00,68142.00000000,68823.42000000,'won',1,'2026-02-18 08:02:35','2026-02-18 08:03:35'), +(13,2,'BTC','down',100.00000000,60,8.00,68175.65000000,68169.15000000,'won',1,'2026-02-18 08:37:39','2026-02-18 08:38:40'); +/*!40000 ALTER TABLE `binary_orders` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contract_orders` +-- + +DROP TABLE IF EXISTS `contract_orders`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `contract_orders` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `symbol` varchar(20) NOT NULL, + `type` enum('limit','market') DEFAULT 'market', + `direction` varchar(10) DEFAULT NULL, + `leverage` int(11) DEFAULT 1, + `amount` decimal(20,8) NOT NULL, + `entry_price` decimal(20,8) DEFAULT NULL, + `close_price` decimal(20,8) DEFAULT NULL, + `status` enum('open','closed','cancelled') DEFAULT 'open', + `profit` decimal(20,8) DEFAULT 0.00000000, + `control_status` tinyint(4) DEFAULT 0 COMMENT '0: normal, 1: force win, 2: force loss', + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contract_orders` +-- + +LOCK TABLES `contract_orders` WRITE; +/*!40000 ALTER TABLE `contract_orders` DISABLE KEYS */; +/*!40000 ALTER TABLE `contract_orders` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `exchange_records` +-- + +DROP TABLE IF EXISTS `exchange_records`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `exchange_records` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `from_symbol` varchar(10) NOT NULL, + `to_symbol` varchar(10) NOT NULL, + `from_amount` decimal(20,8) NOT NULL, + `to_amount` decimal(20,8) NOT NULL, + `rate` decimal(20,8) NOT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `exchange_records` +-- + +LOCK TABLES `exchange_records` WRITE; +/*!40000 ALTER TABLE `exchange_records` DISABLE KEYS */; +/*!40000 ALTER TABLE `exchange_records` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `finance_requests` +-- + +DROP TABLE IF EXISTS `finance_requests`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `finance_requests` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `type` enum('recharge','withdrawal') NOT NULL, + `amount` decimal(20,8) NOT NULL, + `symbol` varchar(10) DEFAULT 'USDT', + `status` enum('pending','approved','rejected') DEFAULT 'pending', + `payment_method` varchar(50) DEFAULT NULL, + `payment_details` text DEFAULT NULL, + `rejection_reason` text DEFAULT NULL, + `tx_hash` varchar(255) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), + `fiat_amount` decimal(20,2) DEFAULT NULL, + `fiat_currency` varchar(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `finance_requests` +-- + +LOCK TABLES `finance_requests` WRITE; +/*!40000 ALTER TABLE `finance_requests` DISABLE KEYS */; +INSERT INTO `finance_requests` VALUES +(1,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 04:45:54','2026-02-18 04:46:29',NULL,NULL), +(2,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:15:15','2026-02-18 06:16:15',NULL,NULL), +(3,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:33:05','2026-02-18 06:33:17',NULL,NULL), +(4,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR: 50000)',NULL,NULL,'','2026-02-18 06:37:57','2026-02-18 06:38:22',NULL,NULL), +(5,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:54:02','2026-02-18 06:54:16',1000.00,'MYR'), +(6,2,'withdrawal',9249.28000000,'USDT','approved',NULL,'Fiat (MYR)',NULL,NULL,'2026-02-18 06:54:44','2026-02-18 06:54:58',44119.07,'MYR'), +(7,2,'recharge',10000.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 06:56:22','2026-02-18 06:56:45',10000.00,'USD'), +(8,2,'recharge',100.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 07:09:10','2026-02-18 07:10:11',100.00,'USD'), +(9,2,'withdrawal',1000.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 08:13:47','2026-02-18 08:14:10',1000.00,'USD'), +(10,2,'recharge',100.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 09:05:05','2026-02-18 09:05:52',100.00,'USD'), +(11,2,'withdrawal',100.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 09:06:13','2026-02-18 09:06:48',100.00,'USD'), +(12,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 09:26:51','2026-02-18 09:27:12',1000.00,'MYR'), +(13,2,'withdrawal',700.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 09:27:38','2026-02-18 09:27:52',700.00,'USD'), +(14,2,'recharge',746.27000000,'USDT','approved','Fiat (SGD)',NULL,NULL,'','2026-02-18 11:17:06','2026-02-18 11:18:57',1000.00,'SGD'), +(15,2,'withdrawal',1000.00000000,'USDT','approved',NULL,'Fiat (MYR)',NULL,NULL,'2026-02-18 11:18:24','2026-02-18 11:19:04',4770.00,'MYR'), +(16,2,'recharge',1000.00000000,'USDT','approved','TRC20',NULL,NULL,'','2026-02-18 11:21:13','2026-02-18 11:21:33',NULL,NULL), +(17,2,'recharge',746.26865672,'USDT','approved','Fiat (SGD)',NULL,NULL,'','2026-02-18 11:41:32','2026-02-18 11:41:46',1000.00,'SGD'); +/*!40000 ALTER TABLE `finance_requests` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `messages` +-- + +DROP TABLE IF EXISTS `messages`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `messages` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) DEFAULT NULL, + `admin_id` int(11) DEFAULT NULL, + `sender` enum('user','admin') DEFAULT NULL, + `message` text DEFAULT NULL, + `ip_address` varchar(45) DEFAULT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `messages` +-- + +LOCK TABLES `messages` WRITE; +/*!40000 ALTER TABLE `messages` DISABLE KEYS */; +INSERT INTO `messages` VALUES +(1,1,NULL,'user','1','::1','2026-02-16 03:27:13'), +(2,1,1,'admin','1','::1','2026-02-16 03:27:24'), +(3,1,NULL,'user','1','::1','2026-02-16 05:05:24'), +(4,1,1,'admin','你好','::1','2026-02-16 05:05:50'), +(5,1,NULL,'user','[Recharge Request]Fiat Amount: 1000 CNYEstimated USDT: 139.08 USDTPlease provide payment details.','::1','2026-02-16 06:43:24'), +(6,1,NULL,'user','1','::1','2026-02-18 03:03:47'), +(7,1,1,'admin','222','::1','2026-02-18 03:04:14'), +(8,2,NULL,'user','【充值】类型:法币充值金额:1000 MYR预计到账 USDT:209.64 USDT','::1','2026-02-18 03:21:37'), +(9,2,NULL,'user','【充值】类型:法币充值金额:1000 MYR预计到账 USDT:209.64 USDT','::1','2026-02-18 04:45:54'), +(10,2,2,'admin','11','::1','2026-02-18 09:00:56'), +(11,2,NULL,'user','你好手上','::1','2026-02-18 09:04:32'), +(12,2,1,'admin','你好','::1','2026-02-18 09:04:43'), +(13,2,NULL,'user','[RECHARGE REQUEST]------------------Type: Fiat RechargeAmount: 100 USDRate: 1 USDT = 1 USDEst. USDT: 100.00 USDTStatus: Pending Approval------------------Please confirm my deposit.','::1','2026-02-18 09:05:05'), +(14,2,NULL,'user','[WITHDRAWAL REQUEST]------------------Type: Fiat WithdrawalAmount: 100.00 USDTRate: 1 USDT = 1 USDTo Receive: 100.00 USD------------------Please process my fiat withdrawal.','::1','2026-02-18 09:06:13'), +(15,2,1,'admin','2222','::1','2026-02-18 09:21:27'), +(16,2,NULL,'user','2222','::1','2026-02-18 09:21:34'), +(17,2,NULL,'user','1','::1','2026-02-18 09:21:37'), +(18,2,1,'admin','123','::1','2026-02-18 09:25:25'), +(19,2,NULL,'user','321','::1','2026-02-18 09:25:32'), +(20,2,NULL,'user','recharge_msg_fiat','::1','2026-02-18 09:26:52'), +(21,2,NULL,'user','withdraw_msg_fiat','::1','2026-02-18 09:27:38'), +(22,2,NULL,'user','用户ID:05617613 申请充值金额:1000 SGD=1.34USDT','::1','2026-02-18 11:17:06'), +(23,2,1,'admin','1','::1','2026-02-18 11:17:41'), +(24,2,NULL,'user','用户ID:05617613 申请提现金额:1000.00 MYR=4.77USDT','::1','2026-02-18 11:18:24'), +(25,2,NULL,'user','用户ID:05617613 申请充值金额:1000 USDT (TRC20)','::1','2026-02-18 11:21:13'), +(26,2,NULL,'user','用户ID:05617613 申请充值金额:1000 SGD=746.2687USDT','::1','2026-02-18 11:41:32'), +(27,0,NULL,'user','你好手上','::1','2026-02-18 13:40:18'); +/*!40000 ALTER TABLE `messages` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `price_controls` +-- + +DROP TABLE IF EXISTS `price_controls`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `price_controls` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `symbol` varchar(20) NOT NULL, + `target_price` decimal(20,8) NOT NULL, + `execution_time` timestamp NOT NULL, + `duration` int(11) DEFAULT 60 COMMENT 'seconds', + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `price_controls` +-- + +LOCK TABLES `price_controls` WRITE; +/*!40000 ALTER TABLE `price_controls` DISABLE KEYS */; +/*!40000 ALTER TABLE `price_controls` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `spot_orders` +-- + +DROP TABLE IF EXISTS `spot_orders`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `spot_orders` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `symbol` varchar(20) NOT NULL, + `side` enum('buy','sell') NOT NULL, + `price` decimal(20,8) DEFAULT NULL, + `amount` decimal(20,8) NOT NULL, + `filled` decimal(20,8) DEFAULT 0.00000000, + `status` enum('pending','filled','cancelled') DEFAULT 'pending', + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `spot_orders` +-- + +LOCK TABLES `spot_orders` WRITE; +/*!40000 ALTER TABLE `spot_orders` DISABLE KEYS */; +/*!40000 ALTER TABLE `spot_orders` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `staking_records` +-- + +DROP TABLE IF EXISTS `staking_records`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `staking_records` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `plan_name` varchar(100) NOT NULL, + `amount` decimal(20,8) NOT NULL, + `symbol` varchar(10) DEFAULT 'USDT', + `daily_profit` decimal(5,2) NOT NULL, + `period` int(11) NOT NULL COMMENT 'days', + `status` enum('running','ended') DEFAULT 'running', + `start_date` date NOT NULL, + `end_date` date NOT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `staking_records` +-- + +LOCK TABLES `staking_records` WRITE; +/*!40000 ALTER TABLE `staking_records` DISABLE KEYS */; +/*!40000 ALTER TABLE `staking_records` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `system_settings` +-- + +DROP TABLE IF EXISTS `system_settings`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `system_settings` ( + `setting_key` varchar(50) NOT NULL, + `setting_value` text DEFAULT NULL, + PRIMARY KEY (`setting_key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `system_settings` +-- + +LOCK TABLES `system_settings` WRITE; +/*!40000 ALTER TABLE `system_settings` DISABLE KEYS */; +INSERT INTO `system_settings` VALUES +('android_download_url','/downloads/byro.apk'), +('apk_download_url','/downloads/byro.apk'), +('email_verification_enabled','0'), +('ios_download_url','/downloads/byro.apk'), +('mail_from_email',''), +('mail_from_name','Byro Exchange'), +('service_link',''), +('site_logo','/assets/pasted-20260219-011659-0f2b767b.png'), +('site_name','Byro'), +('smtp_host',''), +('smtp_pass',''), +('smtp_port','587'), +('smtp_secure','tls'), +('smtp_user',''), +('usdt_bep20_address','0x742d35Cc6634C0532925a3b844Bc454e4438f44e'), +('usdt_erc20_address','0x742d35Cc6634C0532925a3b844Bc454e4438f44e'), +('usdt_protocol','TRC20'), +('usdt_recharge_address',''), +('usdt_trc20_address','TYv9V5J1P1eEwz7y3WqJg9M2yv7f7xXv3x'); +/*!40000 ALTER TABLE `system_settings` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `transactions` +-- + +DROP TABLE IF EXISTS `transactions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `transactions` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `type` varchar(20) NOT NULL, + `amount` decimal(20,8) NOT NULL, + `symbol` varchar(10) NOT NULL, + `status` varchar(20) DEFAULT 'completed', + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `transactions` +-- + +LOCK TABLES `transactions` WRITE; +/*!40000 ALTER TABLE `transactions` DISABLE KEYS */; +INSERT INTO `transactions` VALUES +(1,1,'deposit',5000.00000000,'USDT','completed','2026-02-15 15:40:31'), +(2,1,'deposit',1000.00000000,'USDT','completed','2026-02-15 15:45:53'), +(3,2,'recharge',209.64000000,'USDT','completed','2026-02-18 04:46:29'), +(4,2,'recharge',10.00000000,'USDT','completed','2026-02-18 06:16:15'), +(5,2,'recharge',10.00000000,'USDT','completed','2026-02-18 06:33:17'), +(6,2,'recharge',10.00000000,'USDT','completed','2026-02-18 06:38:22'), +(7,2,'recharge',209.64000000,'USDT','completed','2026-02-18 06:54:16'), +(8,2,'withdrawal',9249.28000000,'USDT','pending','2026-02-18 06:54:44'), +(9,2,'recharge',10000.00000000,'USDT','completed','2026-02-18 06:56:45'), +(10,2,'recharge',100.00000000,'USDT','completed','2026-02-18 07:10:11'), +(11,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59'), +(12,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59'), +(13,2,'binary_win',1080.00000000,'USDT','completed','2026-02-18 08:00:59'), +(14,2,'binary_win',540.00000000,'USDT','completed','2026-02-18 08:00:59'), +(15,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59'), +(16,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59'), +(17,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), +(18,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), +(19,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), +(20,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), +(21,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), +(22,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:03:35'), +(23,2,'withdrawal',1000.00000000,'USDT','completed','2026-02-18 08:13:47'), +(24,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:38:40'), +(25,2,'recharge',100.00000000,'USDT','completed','2026-02-18 09:05:52'), +(26,2,'withdrawal',100.00000000,'USDT','completed','2026-02-18 09:06:13'), +(27,2,'recharge',209.64000000,'USDT','completed','2026-02-18 09:27:12'), +(28,2,'withdrawal',700.00000000,'USDT','completed','2026-02-18 09:27:38'), +(29,2,'withdrawal',1000.00000000,'USDT','completed','2026-02-18 11:18:24'), +(30,2,'recharge',746.27000000,'USDT','completed','2026-02-18 11:18:57'), +(31,2,'recharge',1000.00000000,'USDT','completed','2026-02-18 11:21:33'), +(32,2,'recharge',746.26865672,'USDT','completed','2026-02-18 11:41:46'); +/*!40000 ALTER TABLE `transactions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `user_balances` +-- + +DROP TABLE IF EXISTS `user_balances`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `user_balances` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `symbol` varchar(10) NOT NULL, + `available` decimal(20,8) DEFAULT 0.00000000, + `frozen` decimal(20,8) DEFAULT 0.00000000, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`,`symbol`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `user_balances` +-- + +LOCK TABLES `user_balances` WRITE; +/*!40000 ALTER TABLE `user_balances` DISABLE KEYS */; +INSERT INTO `user_balances` VALUES +(1,1,'USDT',6000.00000000,0.00000000), +(6,2,'USDT',11510.17865672,0.00000000); +/*!40000 ALTER TABLE `user_balances` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `users` +-- --- ---------------------------- --- Table structure for users --- ---------------------------- DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; CREATE TABLE `users` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) DEFAULT NULL, @@ -45,7 +514,6 @@ CREATE TABLE `users` ( `kyc_id_number` varchar(50) DEFAULT NULL, `kyc_photo_front` varchar(255) DEFAULT NULL, `kyc_photo_back` varchar(255) DEFAULT NULL, - `kyc_photo_handheld?` varchar(255) DEFAULT NULL, `kyc_photo_handheld` varchar(255) DEFAULT NULL, `kyc_status` int(11) DEFAULT 0 COMMENT '0: Unverified, 1: Pending, 2: Verified, 3: Rejected', `registration_ip` varchar(45) DEFAULT NULL, @@ -59,180 +527,46 @@ CREATE TABLE `users` ( UNIQUE KEY `email` (`email`), UNIQUE KEY `uid` (`uid`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; --- ---------------------------- --- Table structure for user_balances --- ---------------------------- -DROP TABLE IF EXISTS `user_balances`; -CREATE TABLE `user_balances` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `symbol` varchar(10) NOT NULL, - `available` decimal(20,8) DEFAULT 0.00000000, - `frozen` decimal(20,8) DEFAULT 0.00000000, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`,`symbol`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Dumping data for table `users` +-- --- ---------------------------- --- Table structure for system_settings --- ---------------------------- -DROP TABLE IF EXISTS `system_settings`; -CREATE TABLE `system_settings` ( - `setting_key` varchar(50) NOT NULL, - `setting_value` text DEFAULT NULL, - PRIMARY KEY (`setting_key`) +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +INSERT INTO `users` VALUES +(2,'ahao8988998','ahao8988@gmail.com','$2y$10$tdT4vIgddq1kh2isoBRIPe4goiZ3X1cbf2l6vtButmyZx71xP527q','2026-02-18 02:56:51','05617613',80,0,'user',0,0.0000,NULL,'张世豪','123456789','uploads/kyc/2_front_1771391536.jpg','uploads/kyc/2_back_1771391536.jpg','uploads/kyc/2_handheld_1771391536.jpg',2,NULL,'normal',1,'',NULL,NULL); +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2026-02-18 15:07:12 + +-- +-- Table structure for table `mining_orders` +-- + +DROP TABLE IF EXISTS `mining_orders`; +CREATE TABLE `mining_orders` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `user_id` INT NOT NULL, + `symbol` VARCHAR(10) NOT NULL, + `pool_name` VARCHAR(100) NOT NULL, + `amount` DECIMAL(20, 8) NOT NULL, + `apy` DECIMAL(10, 4) NOT NULL, + `period` VARCHAR(20) NOT NULL, + `status` VARCHAR(20) DEFAULT 'running', + `start_time` DATETIME DEFAULT CURRENT_TIMESTAMP, + `end_time` DATETIME, + `last_payout` DATETIME DEFAULT CURRENT_TIMESTAMP, + `total_profit` DECIMAL(20, 8) DEFAULT 0 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -INSERT INTO `system_settings` (setting_key, setting_value) VALUES -('android_download_url', '/downloads/byro.apk'), -('apk_download_url', '/downloads/byro.apk'), -('email_verification_enabled', '0'), -('ios_download_url', '/downloads/byro.apk'), -('mail_from_email', ''), -('mail_from_name', 'Byro Exchange'), -('site_name', 'Byro'), -('smtp_port', '587'), -('smtp_secure', 'tls'), -('usdt_protocol', 'TRC20'), -('usdt_trc20_address', 'TYv9V5J1P1eEwz7y3WqJg9M2yv7f7xXv3x'); - --- ---------------------------- --- Table structure for staking_records --- ---------------------------- -DROP TABLE IF EXISTS `staking_records`; -CREATE TABLE `staking_records` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `plan_name` varchar(100) NOT NULL, - `amount` decimal(20,8) NOT NULL, - `symbol` varchar(10) DEFAULT 'USDT', - `daily_profit` decimal(5,2) NOT NULL, - `period` int(11) NOT NULL COMMENT 'days', - `status` enum('running','ended') DEFAULT 'running', - `start_date` date NOT NULL, - `end_date` date NOT NULL, - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- ---------------------------- --- Table structure for transactions --- ---------------------------- -DROP TABLE IF EXISTS `transactions`; -CREATE TABLE `transactions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `type` varchar(20) NOT NULL, - `amount` decimal(20,8) NOT NULL, - `symbol` varchar(10) NOT NULL, - `status` varchar(20) DEFAULT 'completed', - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- ---------------------------- --- Table structure for binary_orders --- ---------------------------- -DROP TABLE IF EXISTS `binary_orders`; -CREATE TABLE `binary_orders` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `symbol` varchar(20) NOT NULL, - `direction` varchar(10) DEFAULT NULL, - `amount` decimal(20,8) NOT NULL, - `duration` int(11) NOT NULL, - `profit_rate` decimal(5,2) NOT NULL, - `entry_price` decimal(20,8) NOT NULL, - `close_price` decimal(20,8) DEFAULT NULL, - `status` enum('pending','won','lost','cancelled') DEFAULT 'pending', - `control_status` tinyint(4) DEFAULT 0 COMMENT '0: normal, 1: force win, 2: force loss', - `created_at` timestamp NULL DEFAULT current_timestamp(), - `end_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- ---------------------------- --- Table structure for contract_orders --- ---------------------------- -DROP TABLE IF EXISTS `contract_orders`; -CREATE TABLE `contract_orders` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `symbol` varchar(20) NOT NULL, - `type` enum('limit','market') DEFAULT 'market', - `direction` varchar(10) DEFAULT NULL, - `leverage` int(11) DEFAULT 1, - `amount` decimal(20,8) NOT NULL, - `entry_price` decimal(20,8) DEFAULT NULL, - `close_price` decimal(20,8) DEFAULT NULL, - `status` enum('open','closed','cancelled') DEFAULT 'open', - `profit` decimal(20,8) DEFAULT 0.00000000, - `control_status` tinyint(4) DEFAULT 0 COMMENT '0: normal, 1: force win, 2: force loss', - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- ---------------------------- --- Table structure for exchange_records --- ---------------------------- -DROP TABLE IF EXISTS `exchange_records`; -CREATE TABLE `exchange_records` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `from_symbol` varchar(10) NOT NULL, - `to_symbol` varchar(10) NOT NULL, - `from_amount` decimal(20,8) NOT NULL, - `to_amount` decimal(20,8) NOT NULL, - `rate` decimal(20,8) NOT NULL, - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- ---------------------------- --- Table structure for price_controls --- ---------------------------- -DROP TABLE IF EXISTS `price_controls`; -CREATE TABLE `price_controls` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `symbol` varchar(20) NOT NULL, - `target_price` decimal(20,8) NOT NULL, - `execution_time` timestamp NOT NULL, - `duration` int(11) DEFAULT 60 COMMENT 'seconds', - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- ---------------------------- --- Table structure for spot_orders --- ---------------------------- -DROP TABLE IF EXISTS `spot_orders`; -CREATE TABLE `spot_orders` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `symbol` varchar(20) NOT NULL, - `side` enum('buy','sell') NOT NULL, - `price` decimal(20,8) DEFAULT NULL, - `amount` decimal(20,8) NOT NULL, - `filled` decimal(20,8) DEFAULT 0.00000000, - `status` enum('pending','filled','cancelled') DEFAULT 'pending', - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - --- ---------------------------- --- Table structure for messages --- ---------------------------- -DROP TABLE IF EXISTS `messages`; -CREATE TABLE `messages` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) DEFAULT NULL, - `admin_id` int(11) DEFAULT NULL, - `sender` enum('user','admin') DEFAULT NULL, - `message` text DEFAULT NULL, - `ip_address` varchar(45) DEFAULT NULL, - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; - -SET FOREIGN_KEY_CHECKS = 1; diff --git a/db/migrations/001_init_exchange.sql b/db/migrations/001_init_exchange.sql deleted file mode 100644 index 5d15268..0000000 --- a/db/migrations/001_init_exchange.sql +++ /dev/null @@ -1,21 +0,0 @@ -CREATE TABLE IF NOT EXISTS user_balances ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_id INT NOT NULL, - symbol VARCHAR(10) NOT NULL, - available DECIMAL(20, 8) DEFAULT 0, - frozen DECIMAL(20, 8) DEFAULT 0, - UNIQUE KEY (user_id, symbol) -) ENGINE=InnoDB; - -CREATE TABLE IF NOT EXISTS transactions ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_id INT NOT NULL, - type VARCHAR(20) NOT NULL, - amount DECIMAL(20, 8) NOT NULL, - symbol VARCHAR(10) NOT NULL, - status VARCHAR(20) DEFAULT 'completed', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -) ENGINE=InnoDB; - --- Insert a default user balance for testing (assuming user_id 1) -INSERT IGNORE INTO user_balances (user_id, symbol, available) VALUES (1, 'USDT', 0.00); diff --git a/db/migrations/002_add_users_and_settings.sql b/db/migrations/002_add_users_and_settings.sql deleted file mode 100644 index 5f46bc2..0000000 --- a/db/migrations/002_add_users_and_settings.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE IF NOT EXISTS users ( - id INT AUTO_INCREMENT PRIMARY KEY, - username VARCHAR(50) UNIQUE, - email VARCHAR(100) UNIQUE, - password_hash VARCHAR(255) NOT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP -) ENGINE=InnoDB; - -CREATE TABLE IF NOT EXISTS system_settings ( - setting_key VARCHAR(50) PRIMARY KEY, - setting_value TEXT -) ENGINE=InnoDB; - -INSERT IGNORE INTO system_settings (setting_key, setting_value) VALUES ('email_verification_enabled', '0'); diff --git a/db/migrations/003_update_users_for_profile.sql b/db/migrations/003_update_users_for_profile.sql deleted file mode 100644 index 88080bb..0000000 --- a/db/migrations/003_update_users_for_profile.sql +++ /dev/null @@ -1,17 +0,0 @@ --- Add missing fields for Profile, KYC and Security -ALTER TABLE users -ADD COLUMN total_recharge DECIMAL(16,4) DEFAULT 0, -ADD COLUMN transaction_password VARCHAR(255) DEFAULT NULL, -ADD COLUMN kyc_name VARCHAR(100) DEFAULT NULL, -ADD COLUMN kyc_id_number VARCHAR(50) DEFAULT NULL, -ADD COLUMN kyc_photo_front VARCHAR(255) DEFAULT NULL, -ADD COLUMN kyc_photo_back VARCHAR(255) DEFAULT NULL, -ADD COLUMN kyc_photo_handheld VARCHAR(255) DEFAULT NULL, -ADD COLUMN kyc_status INT DEFAULT 0 COMMENT '0: Unverified, 1: Pending, 2: Verified, 3: Rejected'; - --- Update credit_score default -ALTER TABLE users MODIFY COLUMN credit_score INT DEFAULT 80; - --- Ensure existing users have a credit score and UID if missing -UPDATE users SET credit_score = 80 WHERE credit_score IS NULL; -UPDATE users SET uid = LPAD(FLOOR(RAND() * 100000000), 8, '0') WHERE uid IS NULL OR uid = ''; diff --git a/db/migrations/20260218_admin_system.php b/db/migrations/20260218_admin_system.php deleted file mode 100644 index ccc2822..0000000 --- a/db/migrations/20260218_admin_system.php +++ /dev/null @@ -1,88 +0,0 @@ - 'VARCHAR(45) DEFAULT NULL', - 'status' => "ENUM('normal', 'frozen') DEFAULT 'normal'", - 'win_loss_control' => 'TINYINT DEFAULT 0 COMMENT "0: normal, 1: win, 2: loss"', - 'kyc_rejection_reason' => 'TEXT DEFAULT NULL' -]; - -foreach ($columns_to_add as $column => $type) { - try { - $db->exec("ALTER TABLE users ADD COLUMN $column $type"); - echo "Added column $column to users table.\n"; - } catch (PDOException $e) { - echo "Column $column might already exist or error: " . $e->getMessage() . "\n"; - } -} - -// Create admins table -try { - $db->exec("CREATE TABLE IF NOT EXISTS admins ( - id INT AUTO_INCREMENT PRIMARY KEY, - username VARCHAR(50) NOT NULL UNIQUE, - password_hash VARCHAR(255) NOT NULL, - role VARCHAR(20) DEFAULT 'admin', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP - )"); - echo "Created admins table.\n"; - - // Check if any admin exists, if not create default - $stmt = $db->query("SELECT COUNT(*) FROM admins"); - if ($stmt->fetchColumn() == 0) { - $username = 'admin'; - $password = 'admin123'; - $hash = password_hash($password, PASSWORD_DEFAULT); - $db->prepare("INSERT INTO admins (username, password_hash) VALUES (?, ?)")->execute([$username, $hash]); - echo "Created default admin account: admin / admin123\n"; - } -} catch (PDOException $e) { - echo "Error creating admins table: " . $e->getMessage() . "\n"; -} - -// Create recharge/withdrawal tables if not exist -try { - $db->exec("CREATE TABLE IF NOT EXISTS finance_requests ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_id INT NOT NULL, - type ENUM('recharge', 'withdrawal') NOT NULL, - amount DECIMAL(20,8) NOT NULL, - symbol VARCHAR(10) DEFAULT 'USDT', - status ENUM('pending', 'approved', 'rejected') DEFAULT 'pending', - payment_method VARCHAR(50) DEFAULT NULL, - payment_details TEXT DEFAULT NULL, - rejection_reason TEXT DEFAULT NULL, - tx_hash VARCHAR(255) DEFAULT NULL, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP - )"); - echo "Created finance_requests table.\n"; -} catch (PDOException $e) { - echo "Error creating finance_requests table: " . $e->getMessage() . "\n"; -} - -// Create trading tables if not exist (binary, contract) -try { - $db->exec("CREATE TABLE IF NOT EXISTS binary_orders ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_id INT NOT NULL, - symbol VARCHAR(20) NOT NULL, - direction ENUM('buy', 'sell') NOT NULL, - amount DECIMAL(20,8) NOT NULL, - duration INT NOT NULL, - profit_rate DECIMAL(5,2) NOT NULL, - entry_price DECIMAL(20,8) NOT NULL, - close_price DECIMAL(20,8) DEFAULT NULL, - status ENUM('pending', 'won', 'lost', 'cancelled') DEFAULT 'pending', - control_status TINYINT DEFAULT 0 COMMENT '0: normal, 1: force win, 2: force loss', - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - end_at TIMESTAMP NULL DEFAULT NULL - )"); - echo "Created binary_orders table.\n"; -} catch (PDOException $e) { - echo "Error creating binary_orders table: " . $e->getMessage() . "\n"; -} diff --git a/db/migrations/20260218_trading_tables.php b/db/migrations/20260218_trading_tables.php deleted file mode 100644 index b02e690..0000000 --- a/db/migrations/20260218_trading_tables.php +++ /dev/null @@ -1,72 +0,0 @@ -exec($sql); - echo "Table created/verified successfully.\n"; - } catch (PDOException $e) { - echo "Error: " . $e->getMessage() . "\n"; - } -} diff --git a/db/migrations/20260219_create_mining_orders.php b/db/migrations/20260219_create_mining_orders.php deleted file mode 100644 index 2fd8283..0000000 --- a/db/migrations/20260219_create_mining_orders.php +++ /dev/null @@ -1,24 +0,0 @@ -exec("CREATE TABLE IF NOT EXISTS mining_orders ( - id INT AUTO_INCREMENT PRIMARY KEY, - user_id INT NOT NULL, - symbol VARCHAR(10) NOT NULL, - pool_name VARCHAR(100) NOT NULL, - amount DECIMAL(20, 8) NOT NULL, - apy DECIMAL(10, 4) NOT NULL, - period VARCHAR(20) NOT NULL, - status VARCHAR(20) DEFAULT 'running', - start_time DATETIME DEFAULT CURRENT_TIMESTAMP, - end_time DATETIME, - last_payout DATETIME DEFAULT CURRENT_TIMESTAMP, - total_profit DECIMAL(20, 8) DEFAULT 0 - )"); - echo "Table mining_orders created successfully.\n"; -} catch (Exception $e) { - echo "Error creating table: " . $e->getMessage() . "\n"; -} diff --git a/install.sql b/install.sql deleted file mode 100644 index 2ef50ee..0000000 --- a/install.sql +++ /dev/null @@ -1,552 +0,0 @@ -/*M!999999\- enable the sandbox mode */ --- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64) --- --- Host: 127.0.0.1 Database: app_38451 --- ------------------------------------------------------ --- Server version 10.11.14-MariaDB-0+deb12u2 - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8mb4 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Table structure for table `admins` --- - -DROP TABLE IF EXISTS `admins`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `admins` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `username` varchar(50) NOT NULL, - `password_hash` varchar(255) NOT NULL, - `role` varchar(20) DEFAULT 'admin', - `created_at` timestamp NULL DEFAULT current_timestamp(), - `is_agent` tinyint(4) DEFAULT 0, - `permissions` text DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`) -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `admins` --- - -LOCK TABLES `admins` WRITE; -/*!40000 ALTER TABLE `admins` DISABLE KEYS */; -INSERT INTO `admins` VALUES -(1,'admin','$2y$10$uJvcqHNb.naRWj.apBapi.C.fF2zaIbMhYEtVdGmmVUWZkQi9ESfe','admin','2026-02-18 03:07:35',0,NULL); -/*!40000 ALTER TABLE `admins` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `binary_orders` --- - -DROP TABLE IF EXISTS `binary_orders`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `binary_orders` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `symbol` varchar(20) NOT NULL, - `direction` varchar(10) DEFAULT NULL, - `amount` decimal(20,8) NOT NULL, - `duration` int(11) NOT NULL, - `profit_rate` decimal(5,2) NOT NULL, - `entry_price` decimal(20,8) NOT NULL, - `close_price` decimal(20,8) DEFAULT NULL, - `status` enum('pending','won','lost','cancelled') DEFAULT 'pending', - `control_status` tinyint(4) DEFAULT 0 COMMENT '0: normal, 1: force win, 2: force loss', - `created_at` timestamp NULL DEFAULT current_timestamp(), - `end_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `binary_orders` --- - -LOCK TABLES `binary_orders` WRITE; -/*!40000 ALTER TABLE `binary_orders` DISABLE KEYS */; -INSERT INTO `binary_orders` VALUES -(1,2,'BTC','up',100.00000000,60,8.00,67652.01000000,68328.53010000,'won',1,'2026-02-18 06:00:25','2026-02-18 08:00:59'), -(2,2,'BTC','down',100.00000000,60,8.00,67788.80000000,67110.91200000,'won',1,'2026-02-18 06:16:43','2026-02-18 08:00:59'), -(3,2,'BTC','up',1000.00000000,60,8.00,67879.37000000,68558.16370000,'won',1,'2026-02-18 06:40:10','2026-02-18 08:00:59'), -(4,2,'BTC','up',500.00000000,60,8.00,67839.92000000,68518.31920000,'won',1,'2026-02-18 06:57:02','2026-02-18 08:00:59'), -(5,2,'BTC','up',100.00000000,60,8.00,67813.14000000,68491.27140000,'won',1,'2026-02-18 07:07:26','2026-02-18 08:00:59'), -(6,2,'BTC','down',100.00000000,60,8.00,67770.32000000,67092.61680000,'won',1,'2026-02-18 07:17:26','2026-02-18 08:00:59'), -(7,2,'BTC','down',100.00000000,60,8.00,67753.40000000,67075.86600000,'won',1,'2026-02-18 07:22:09','2026-02-18 08:00:59'), -(8,2,'BTC','up',100.00000000,60,8.00,67756.31000000,68433.87310000,'won',1,'2026-02-18 07:27:16','2026-02-18 08:01:00'), -(9,2,'BTC','down',100.00000000,60,8.00,67798.67000000,67120.68330000,'won',1,'2026-02-18 07:33:08','2026-02-18 08:01:00'), -(10,2,'BTC','down',100.00000000,60,8.00,68073.40000000,67392.66600000,'won',1,'2026-02-18 07:44:11','2026-02-18 08:01:00'), -(11,2,'BTC','up',100.00000000,60,8.00,68158.35000000,68839.93350000,'won',1,'2026-02-18 07:50:39','2026-02-18 08:01:00'), -(12,2,'BTC','up',100.00000000,60,8.00,68142.00000000,68823.42000000,'won',1,'2026-02-18 08:02:35','2026-02-18 08:03:35'), -(13,2,'BTC','down',100.00000000,60,8.00,68175.65000000,68169.15000000,'won',1,'2026-02-18 08:37:39','2026-02-18 08:38:40'); -/*!40000 ALTER TABLE `binary_orders` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `contract_orders` --- - -DROP TABLE IF EXISTS `contract_orders`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `contract_orders` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `symbol` varchar(20) NOT NULL, - `type` enum('limit','market') DEFAULT 'market', - `direction` varchar(10) DEFAULT NULL, - `leverage` int(11) DEFAULT 1, - `amount` decimal(20,8) NOT NULL, - `entry_price` decimal(20,8) DEFAULT NULL, - `close_price` decimal(20,8) DEFAULT NULL, - `status` enum('open','closed','cancelled') DEFAULT 'open', - `profit` decimal(20,8) DEFAULT 0.00000000, - `control_status` tinyint(4) DEFAULT 0 COMMENT '0: normal, 1: force win, 2: force loss', - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `contract_orders` --- - -LOCK TABLES `contract_orders` WRITE; -/*!40000 ALTER TABLE `contract_orders` DISABLE KEYS */; -/*!40000 ALTER TABLE `contract_orders` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `exchange_records` --- - -DROP TABLE IF EXISTS `exchange_records`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `exchange_records` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `from_symbol` varchar(10) NOT NULL, - `to_symbol` varchar(10) NOT NULL, - `from_amount` decimal(20,8) NOT NULL, - `to_amount` decimal(20,8) NOT NULL, - `rate` decimal(20,8) NOT NULL, - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `exchange_records` --- - -LOCK TABLES `exchange_records` WRITE; -/*!40000 ALTER TABLE `exchange_records` DISABLE KEYS */; -/*!40000 ALTER TABLE `exchange_records` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `finance_requests` --- - -DROP TABLE IF EXISTS `finance_requests`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `finance_requests` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `type` enum('recharge','withdrawal') NOT NULL, - `amount` decimal(20,8) NOT NULL, - `symbol` varchar(10) DEFAULT 'USDT', - `status` enum('pending','approved','rejected') DEFAULT 'pending', - `payment_method` varchar(50) DEFAULT NULL, - `payment_details` text DEFAULT NULL, - `rejection_reason` text DEFAULT NULL, - `tx_hash` varchar(255) DEFAULT NULL, - `created_at` timestamp NULL DEFAULT current_timestamp(), - `updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), - `fiat_amount` decimal(20,2) DEFAULT NULL, - `fiat_currency` varchar(10) DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `finance_requests` --- - -LOCK TABLES `finance_requests` WRITE; -/*!40000 ALTER TABLE `finance_requests` DISABLE KEYS */; -INSERT INTO `finance_requests` VALUES -(1,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 04:45:54','2026-02-18 04:46:29',NULL,NULL), -(2,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:15:15','2026-02-18 06:16:15',NULL,NULL), -(3,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:33:05','2026-02-18 06:33:17',NULL,NULL), -(4,2,'recharge',10.00000000,'USDT','approved','Fiat (MYR: 50000)',NULL,NULL,'','2026-02-18 06:37:57','2026-02-18 06:38:22',NULL,NULL), -(5,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 06:54:02','2026-02-18 06:54:16',1000.00,'MYR'), -(6,2,'withdrawal',9249.28000000,'USDT','approved',NULL,'Fiat (MYR)',NULL,NULL,'2026-02-18 06:54:44','2026-02-18 06:54:58',44119.07,'MYR'), -(7,2,'recharge',10000.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 06:56:22','2026-02-18 06:56:45',10000.00,'USD'), -(8,2,'recharge',100.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 07:09:10','2026-02-18 07:10:11',100.00,'USD'), -(9,2,'withdrawal',1000.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 08:13:47','2026-02-18 08:14:10',1000.00,'USD'), -(10,2,'recharge',100.00000000,'USDT','approved','Fiat (USD)',NULL,NULL,'','2026-02-18 09:05:05','2026-02-18 09:05:52',100.00,'USD'), -(11,2,'withdrawal',100.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 09:06:13','2026-02-18 09:06:48',100.00,'USD'), -(12,2,'recharge',209.64000000,'USDT','approved','Fiat (MYR)',NULL,NULL,'','2026-02-18 09:26:51','2026-02-18 09:27:12',1000.00,'MYR'), -(13,2,'withdrawal',700.00000000,'USDT','approved',NULL,'Fiat (USD)',NULL,NULL,'2026-02-18 09:27:38','2026-02-18 09:27:52',700.00,'USD'), -(14,2,'recharge',746.27000000,'USDT','approved','Fiat (SGD)',NULL,NULL,'','2026-02-18 11:17:06','2026-02-18 11:18:57',1000.00,'SGD'), -(15,2,'withdrawal',1000.00000000,'USDT','approved',NULL,'Fiat (MYR)',NULL,NULL,'2026-02-18 11:18:24','2026-02-18 11:19:04',4770.00,'MYR'), -(16,2,'recharge',1000.00000000,'USDT','approved','TRC20',NULL,NULL,'','2026-02-18 11:21:13','2026-02-18 11:21:33',NULL,NULL), -(17,2,'recharge',746.26865672,'USDT','approved','Fiat (SGD)',NULL,NULL,'','2026-02-18 11:41:32','2026-02-18 11:41:46',1000.00,'SGD'); -/*!40000 ALTER TABLE `finance_requests` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `messages` --- - -DROP TABLE IF EXISTS `messages`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `messages` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) DEFAULT NULL, - `admin_id` int(11) DEFAULT NULL, - `sender` enum('user','admin') DEFAULT NULL, - `message` text DEFAULT NULL, - `ip_address` varchar(45) DEFAULT NULL, - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `messages` --- - -LOCK TABLES `messages` WRITE; -/*!40000 ALTER TABLE `messages` DISABLE KEYS */; -INSERT INTO `messages` VALUES -(1,1,NULL,'user','1','::1','2026-02-16 03:27:13'), -(2,1,1,'admin','1','::1','2026-02-16 03:27:24'), -(3,1,NULL,'user','1','::1','2026-02-16 05:05:24'), -(4,1,1,'admin','你好','::1','2026-02-16 05:05:50'), -(5,1,NULL,'user','[Recharge Request]Fiat Amount: 1000 CNYEstimated USDT: 139.08 USDTPlease provide payment details.','::1','2026-02-16 06:43:24'), -(6,1,NULL,'user','1','::1','2026-02-18 03:03:47'), -(7,1,1,'admin','222','::1','2026-02-18 03:04:14'), -(8,2,NULL,'user','【充值】类型:法币充值金额:1000 MYR预计到账 USDT:209.64 USDT','::1','2026-02-18 03:21:37'), -(9,2,NULL,'user','【充值】类型:法币充值金额:1000 MYR预计到账 USDT:209.64 USDT','::1','2026-02-18 04:45:54'), -(10,2,2,'admin','11','::1','2026-02-18 09:00:56'), -(11,2,NULL,'user','你好手上','::1','2026-02-18 09:04:32'), -(12,2,1,'admin','你好','::1','2026-02-18 09:04:43'), -(13,2,NULL,'user','[RECHARGE REQUEST]------------------Type: Fiat RechargeAmount: 100 USDRate: 1 USDT = 1 USDEst. USDT: 100.00 USDTStatus: Pending Approval------------------Please confirm my deposit.','::1','2026-02-18 09:05:05'), -(14,2,NULL,'user','[WITHDRAWAL REQUEST]------------------Type: Fiat WithdrawalAmount: 100.00 USDTRate: 1 USDT = 1 USDTo Receive: 100.00 USD------------------Please process my fiat withdrawal.','::1','2026-02-18 09:06:13'), -(15,2,1,'admin','2222','::1','2026-02-18 09:21:27'), -(16,2,NULL,'user','2222','::1','2026-02-18 09:21:34'), -(17,2,NULL,'user','1','::1','2026-02-18 09:21:37'), -(18,2,1,'admin','123','::1','2026-02-18 09:25:25'), -(19,2,NULL,'user','321','::1','2026-02-18 09:25:32'), -(20,2,NULL,'user','recharge_msg_fiat','::1','2026-02-18 09:26:52'), -(21,2,NULL,'user','withdraw_msg_fiat','::1','2026-02-18 09:27:38'), -(22,2,NULL,'user','用户ID:05617613 申请充值金额:1000 SGD=1.34USDT','::1','2026-02-18 11:17:06'), -(23,2,1,'admin','1','::1','2026-02-18 11:17:41'), -(24,2,NULL,'user','用户ID:05617613 申请提现金额:1000.00 MYR=4.77USDT','::1','2026-02-18 11:18:24'), -(25,2,NULL,'user','用户ID:05617613 申请充值金额:1000 USDT (TRC20)','::1','2026-02-18 11:21:13'), -(26,2,NULL,'user','用户ID:05617613 申请充值金额:1000 SGD=746.2687USDT','::1','2026-02-18 11:41:32'), -(27,0,NULL,'user','你好手上','::1','2026-02-18 13:40:18'); -/*!40000 ALTER TABLE `messages` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `price_controls` --- - -DROP TABLE IF EXISTS `price_controls`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `price_controls` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `symbol` varchar(20) NOT NULL, - `target_price` decimal(20,8) NOT NULL, - `execution_time` timestamp NOT NULL, - `duration` int(11) DEFAULT 60 COMMENT 'seconds', - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `price_controls` --- - -LOCK TABLES `price_controls` WRITE; -/*!40000 ALTER TABLE `price_controls` DISABLE KEYS */; -/*!40000 ALTER TABLE `price_controls` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `spot_orders` --- - -DROP TABLE IF EXISTS `spot_orders`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `spot_orders` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `symbol` varchar(20) NOT NULL, - `side` enum('buy','sell') NOT NULL, - `price` decimal(20,8) DEFAULT NULL, - `amount` decimal(20,8) NOT NULL, - `filled` decimal(20,8) DEFAULT 0.00000000, - `status` enum('pending','filled','cancelled') DEFAULT 'pending', - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `spot_orders` --- - -LOCK TABLES `spot_orders` WRITE; -/*!40000 ALTER TABLE `spot_orders` DISABLE KEYS */; -/*!40000 ALTER TABLE `spot_orders` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `staking_records` --- - -DROP TABLE IF EXISTS `staking_records`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `staking_records` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `plan_name` varchar(100) NOT NULL, - `amount` decimal(20,8) NOT NULL, - `symbol` varchar(10) DEFAULT 'USDT', - `daily_profit` decimal(5,2) NOT NULL, - `period` int(11) NOT NULL COMMENT 'days', - `status` enum('running','ended') DEFAULT 'running', - `start_date` date NOT NULL, - `end_date` date NOT NULL, - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `staking_records` --- - -LOCK TABLES `staking_records` WRITE; -/*!40000 ALTER TABLE `staking_records` DISABLE KEYS */; -/*!40000 ALTER TABLE `staking_records` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `system_settings` --- - -DROP TABLE IF EXISTS `system_settings`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `system_settings` ( - `setting_key` varchar(50) NOT NULL, - `setting_value` text DEFAULT NULL, - PRIMARY KEY (`setting_key`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `system_settings` --- - -LOCK TABLES `system_settings` WRITE; -/*!40000 ALTER TABLE `system_settings` DISABLE KEYS */; -INSERT INTO `system_settings` VALUES -('android_download_url','/downloads/byro.apk'), -('apk_download_url','/downloads/byro.apk'), -('email_verification_enabled','0'), -('ios_download_url','/downloads/byro.apk'), -('mail_from_email',''), -('mail_from_name','Byro Exchange'), -('service_link',''), -('site_logo','/assets/pasted-20260219-011659-0f2b767b.png'), -('site_name','Byro'), -('smtp_host',''), -('smtp_pass',''), -('smtp_port','587'), -('smtp_secure','tls'), -('smtp_user',''), -('usdt_bep20_address','0x742d35Cc6634C0532925a3b844Bc454e4438f44e'), -('usdt_erc20_address','0x742d35Cc6634C0532925a3b844Bc454e4438f44e'), -('usdt_protocol','TRC20'), -('usdt_recharge_address',''), -('usdt_trc20_address','TYv9V5J1P1eEwz7y3WqJg9M2yv7f7xXv3x'); -/*!40000 ALTER TABLE `system_settings` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `transactions` --- - -DROP TABLE IF EXISTS `transactions`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `transactions` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `type` varchar(20) NOT NULL, - `amount` decimal(20,8) NOT NULL, - `symbol` varchar(10) NOT NULL, - `status` varchar(20) DEFAULT 'completed', - `created_at` timestamp NULL DEFAULT current_timestamp(), - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `transactions` --- - -LOCK TABLES `transactions` WRITE; -/*!40000 ALTER TABLE `transactions` DISABLE KEYS */; -INSERT INTO `transactions` VALUES -(1,1,'deposit',5000.00000000,'USDT','completed','2026-02-15 15:40:31'), -(2,1,'deposit',1000.00000000,'USDT','completed','2026-02-15 15:45:53'), -(3,2,'recharge',209.64000000,'USDT','completed','2026-02-18 04:46:29'), -(4,2,'recharge',10.00000000,'USDT','completed','2026-02-18 06:16:15'), -(5,2,'recharge',10.00000000,'USDT','completed','2026-02-18 06:33:17'), -(6,2,'recharge',10.00000000,'USDT','completed','2026-02-18 06:38:22'), -(7,2,'recharge',209.64000000,'USDT','completed','2026-02-18 06:54:16'), -(8,2,'withdrawal',9249.28000000,'USDT','pending','2026-02-18 06:54:44'), -(9,2,'recharge',10000.00000000,'USDT','completed','2026-02-18 06:56:45'), -(10,2,'recharge',100.00000000,'USDT','completed','2026-02-18 07:10:11'), -(11,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59'), -(12,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59'), -(13,2,'binary_win',1080.00000000,'USDT','completed','2026-02-18 08:00:59'), -(14,2,'binary_win',540.00000000,'USDT','completed','2026-02-18 08:00:59'), -(15,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59'), -(16,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:00:59'), -(17,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), -(18,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), -(19,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), -(20,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), -(21,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:01:00'), -(22,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:03:35'), -(23,2,'withdrawal',1000.00000000,'USDT','completed','2026-02-18 08:13:47'), -(24,2,'binary_win',108.00000000,'USDT','completed','2026-02-18 08:38:40'), -(25,2,'recharge',100.00000000,'USDT','completed','2026-02-18 09:05:52'), -(26,2,'withdrawal',100.00000000,'USDT','completed','2026-02-18 09:06:13'), -(27,2,'recharge',209.64000000,'USDT','completed','2026-02-18 09:27:12'), -(28,2,'withdrawal',700.00000000,'USDT','completed','2026-02-18 09:27:38'), -(29,2,'withdrawal',1000.00000000,'USDT','completed','2026-02-18 11:18:24'), -(30,2,'recharge',746.27000000,'USDT','completed','2026-02-18 11:18:57'), -(31,2,'recharge',1000.00000000,'USDT','completed','2026-02-18 11:21:33'), -(32,2,'recharge',746.26865672,'USDT','completed','2026-02-18 11:41:46'); -/*!40000 ALTER TABLE `transactions` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `user_balances` --- - -DROP TABLE IF EXISTS `user_balances`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `user_balances` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `user_id` int(11) NOT NULL, - `symbol` varchar(10) NOT NULL, - `available` decimal(20,8) DEFAULT 0.00000000, - `frozen` decimal(20,8) DEFAULT 0.00000000, - PRIMARY KEY (`id`), - UNIQUE KEY `user_id` (`user_id`,`symbol`) -) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `user_balances` --- - -LOCK TABLES `user_balances` WRITE; -/*!40000 ALTER TABLE `user_balances` DISABLE KEYS */; -INSERT INTO `user_balances` VALUES -(1,1,'USDT',6000.00000000,0.00000000), -(6,2,'USDT',11510.17865672,0.00000000); -/*!40000 ALTER TABLE `user_balances` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Table structure for table `users` --- - -DROP TABLE IF EXISTS `users`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `users` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `username` varchar(50) DEFAULT NULL, - `email` varchar(100) DEFAULT NULL, - `password_hash` varchar(255) NOT NULL, - `created_at` timestamp NULL DEFAULT current_timestamp(), - `uid` varchar(20) DEFAULT NULL, - `credit_score` int(11) DEFAULT 80, - `real_name_status` int(11) DEFAULT 0, - `role` varchar(20) DEFAULT 'user', - `vip_level` int(11) DEFAULT 0, - `total_recharge` decimal(16,4) DEFAULT 0.0000, - `transaction_password` varchar(255) DEFAULT NULL, - `kyc_name` varchar(100) DEFAULT NULL, - `kyc_id_number` varchar(50) DEFAULT NULL, - `kyc_photo_front` varchar(255) DEFAULT NULL, - `kyc_photo_back` varchar(255) DEFAULT NULL, - `kyc_photo_handheld` varchar(255) DEFAULT NULL, - `kyc_status` int(11) DEFAULT 0 COMMENT '0: Unverified, 1: Pending, 2: Verified, 3: Rejected', - `registration_ip` varchar(45) DEFAULT NULL, - `status` enum('normal','frozen') DEFAULT 'normal', - `win_loss_control` tinyint(4) DEFAULT 0 COMMENT '0: normal, 1: win, 2: loss', - `remark` text DEFAULT NULL, - `kyc_rejection_reason` text DEFAULT NULL, - `agent_id` int(11) DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `username` (`username`), - UNIQUE KEY `email` (`email`), - UNIQUE KEY `uid` (`uid`) -) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `users` --- - -LOCK TABLES `users` WRITE; -/*!40000 ALTER TABLE `users` DISABLE KEYS */; -INSERT INTO `users` VALUES -(2,'ahao8988998','ahao8988@gmail.com','$2y$10$tdT4vIgddq1kh2isoBRIPe4goiZ3X1cbf2l6vtButmyZx71xP527q','2026-02-18 02:56:51','05617613',80,0,'user',0,0.0000,NULL,'张世豪','123456789','uploads/kyc/2_front_1771391536.jpg','uploads/kyc/2_back_1771391536.jpg','uploads/kyc/2_handheld_1771391536.jpg',2,NULL,'normal',1,'',NULL,NULL); -/*!40000 ALTER TABLE `users` ENABLE KEYS */; -UNLOCK TABLES; -/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; - -/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; -/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; -/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; -/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; -/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; -/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; -/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; - --- Dump completed on 2026-02-18 15:07:12