From aeb4af6f0f848ef18c36fb8404fc305f22732d34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=94=E5=A7=AC=E6=A1=91?= Date: Tue, 25 Aug 2020 14:35:30 +0800 Subject: [PATCH] =?UTF-8?q?2.4.0=20phase=203:=20db.sql=20=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E8=87=B3=20Migration=20=20+=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Components/Helpers.php | 4 +- app/Console/Commands/AutoClearLog.php | 6 +- app/Console/Commands/AutoJob.php | 32 +- app/Console/Commands/DailyJob.php | 4 +- .../UserTrafficAbnormalAutoWarning.php | 22 +- .../Commands/UserTrafficAutoWarning.php | 5 +- .../Controllers/Admin/CouponController.php | 3 +- .../Controllers/Admin/SubscribeController.php | 2 +- app/Http/Controllers/AdminController.php | 26 +- app/Http/Controllers/AuthController.php | 13 +- app/Http/Controllers/Controller.php | 6 +- .../Controllers/Gateway/AbstractPayment.php | 3 +- app/Http/Controllers/NodeController.php | 9 +- .../Controllers/User/SubscribeController.php | 5 +- app/Http/Controllers/UserController.php | 11 +- app/Models/EmailFilter.php | 1 + app/Models/Label.php | 1 + app/Models/Level.php | 1 + app/Models/Rule.php | 1 + app/Models/SsConfig.php | 1 + app/Models/UserSubscribeLog.php | 2 +- app/Observers/NodeObserver.php | 5 +- app/Observers/UserObserver.php | 7 + app/helpers.php | 19 - composer.json | 1 - composer.lock | 902 ++++--- ...2020_08_21_145711_create_article_table.php | 36 + .../2020_08_21_145711_create_config_table.php | 28 + ...2020_08_21_145711_create_country_table.php | 28 + ...0_08_21_145711_create_coupon_log_table.php | 32 + .../2020_08_21_145711_create_coupon_table.php | 40 + ...08_21_145711_create_email_filter_table.php | 29 + ..._08_21_145711_create_failed_jobs_table.php | 32 + .../2020_08_21_145711_create_goods_table.php | 47 + .../2020_08_21_145711_create_invite_table.php | 35 + .../2020_08_21_145711_create_jobs_table.php | 33 + .../2020_08_21_145711_create_label_table.php | 29 + .../2020_08_21_145711_create_level_table.php | 29 + ...20_08_21_145711_create_marketing_table.php | 35 + ...20_08_21_145711_create_node_auth_table.php | 32 + ...1_145711_create_node_certificate_table.php | 32 + ...5711_create_node_daily_data_flow_table.php | 33 + ...711_create_node_hourly_data_flow_table.php | 33 + ...0_08_21_145711_create_node_label_table.php | 30 + ...20_08_21_145711_create_node_ping_table.php | 33 + ...20_08_21_145711_create_node_rule_table.php | 32 + ...1_145711_create_notification_log_table.php | 35 + .../2020_08_21_145711_create_order_table.php | 41 + ...1_145711_create_payment_callback_table.php | 33 + ...2020_08_21_145711_create_payment_table.php | 36 + ...8_21_145711_create_products_pool_table.php | 33 + ..._21_145711_create_referral_apply_table.php | 35 + ...08_21_145711_create_referral_log_table.php | 35 + ...21_145711_create_rule_group_node_table.php | 31 + ...0_08_21_145711_create_rule_group_table.php | 33 + ...020_08_21_145711_create_rule_log_table.php | 33 + .../2020_08_21_145711_create_rule_table.php | 30 + ...20_08_21_145711_create_ss_config_table.php | 31 + ...08_21_145711_create_ss_node_info_table.php | 31 + ...0_08_21_145711_create_ss_node_ip_table.php | 33 + ...145711_create_ss_node_online_log_table.php | 30 + ...020_08_21_145711_create_ss_node_table.php} | 38 +- ...08_21_145711_create_ticket_reply_table.php | 33 + .../2020_08_21_145711_create_ticket_table.php | 34 + ..._21_145711_create_user_baned_log_table.php | 33 + ...21_145711_create_user_credit_log_table.php | 34 + ...5711_create_user_daily_data_flow_table.php | 35 + ...5711_create_user_data_modify_log_table.php | 33 + ...0_08_21_145711_create_user_group_table.php | 29 + ...711_create_user_hourly_data_flow_table.php | 35 + ..._21_145711_create_user_login_log_table.php | 36 + ...145711_create_user_subscribe_log_table.php | 31 + ..._21_145711_create_user_subscribe_table.php | 36 + .../2020_08_21_145711_create_user_table.php | 63 + ...1_145711_create_user_traffic_log_table.php | 35 + ..._08_21_145711_create_verify_code_table.php | 32 + .../2020_08_21_145711_create_verify_table.php | 33 + .../2020_08_21_150711_preset_data.php | 528 ++++ .../admin/subscribe/subscribeList.blade.php | 2 +- sql/db.sql | 2403 ++++++++--------- sql/mod/20200823.sql | 92 + 81 files changed, 3984 insertions(+), 1861 deletions(-) create mode 100644 database/migrations/2020_08_21_145711_create_article_table.php create mode 100644 database/migrations/2020_08_21_145711_create_config_table.php create mode 100644 database/migrations/2020_08_21_145711_create_country_table.php create mode 100644 database/migrations/2020_08_21_145711_create_coupon_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_coupon_table.php create mode 100644 database/migrations/2020_08_21_145711_create_email_filter_table.php create mode 100644 database/migrations/2020_08_21_145711_create_failed_jobs_table.php create mode 100644 database/migrations/2020_08_21_145711_create_goods_table.php create mode 100644 database/migrations/2020_08_21_145711_create_invite_table.php create mode 100644 database/migrations/2020_08_21_145711_create_jobs_table.php create mode 100644 database/migrations/2020_08_21_145711_create_label_table.php create mode 100644 database/migrations/2020_08_21_145711_create_level_table.php create mode 100644 database/migrations/2020_08_21_145711_create_marketing_table.php create mode 100644 database/migrations/2020_08_21_145711_create_node_auth_table.php create mode 100644 database/migrations/2020_08_21_145711_create_node_certificate_table.php create mode 100644 database/migrations/2020_08_21_145711_create_node_daily_data_flow_table.php create mode 100644 database/migrations/2020_08_21_145711_create_node_hourly_data_flow_table.php create mode 100644 database/migrations/2020_08_21_145711_create_node_label_table.php create mode 100644 database/migrations/2020_08_21_145711_create_node_ping_table.php create mode 100644 database/migrations/2020_08_21_145711_create_node_rule_table.php create mode 100644 database/migrations/2020_08_21_145711_create_notification_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_order_table.php create mode 100644 database/migrations/2020_08_21_145711_create_payment_callback_table.php create mode 100644 database/migrations/2020_08_21_145711_create_payment_table.php create mode 100644 database/migrations/2020_08_21_145711_create_products_pool_table.php create mode 100644 database/migrations/2020_08_21_145711_create_referral_apply_table.php create mode 100644 database/migrations/2020_08_21_145711_create_referral_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_rule_group_node_table.php create mode 100644 database/migrations/2020_08_21_145711_create_rule_group_table.php create mode 100644 database/migrations/2020_08_21_145711_create_rule_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_rule_table.php create mode 100644 database/migrations/2020_08_21_145711_create_ss_config_table.php create mode 100644 database/migrations/2020_08_21_145711_create_ss_node_info_table.php create mode 100644 database/migrations/2020_08_21_145711_create_ss_node_ip_table.php create mode 100644 database/migrations/2020_08_21_145711_create_ss_node_online_log_table.php rename database/migrations/{2020_07_18_032504_create_node_table.php => 2020_08_21_145711_create_ss_node_table.php} (71%) create mode 100644 database/migrations/2020_08_21_145711_create_ticket_reply_table.php create mode 100644 database/migrations/2020_08_21_145711_create_ticket_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_baned_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_credit_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_daily_data_flow_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_data_modify_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_group_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_hourly_data_flow_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_login_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_subscribe_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_subscribe_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_table.php create mode 100644 database/migrations/2020_08_21_145711_create_user_traffic_log_table.php create mode 100644 database/migrations/2020_08_21_145711_create_verify_code_table.php create mode 100644 database/migrations/2020_08_21_145711_create_verify_table.php create mode 100644 database/migrations/2020_08_21_150711_preset_data.php create mode 100644 sql/mod/20200823.sql diff --git a/app/Components/Helpers.php b/app/Components/Helpers.php index 3d8b9f8b..adc6f588 100644 --- a/app/Components/Helpers.php +++ b/app/Components/Helpers.php @@ -57,7 +57,7 @@ class Helpers { // 生成用户的订阅码 public static function makeSubscribeCode(): string { - $code = makeRandStr(5); + $code = Str::random(); if(UserSubscribe::whereCode($code)->exists()){ $code = self::makeSubscribeCode(); } @@ -83,7 +83,7 @@ class Helpers { $user->password = $password; // 生成一个可用端口 $user->port = self::sysConfig()['is_rand_port']? self::getRandPort() : self::getOnlyPort(); - $user->passwd = makeRandStr(); + $user->passwd = Str::random(); $user->vmess_id = Str::uuid(); $user->enable = 1; $user->method = self::getDefaultMethod(); diff --git a/app/Console/Commands/AutoClearLog.php b/app/Console/Commands/AutoClearLog.php index 04c76d31..46432e45 100644 --- a/app/Console/Commands/AutoClearLog.php +++ b/app/Console/Commands/AutoClearLog.php @@ -50,14 +50,12 @@ class AutoClearLog extends Command { // 清除用户每时各流量数据日志 UserHourlyDataFlow::where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 days')))->delete(); - // 清除用户各节点的每天流量数据日志 + // 清除用户各节点 / 节点总计的每天流量数据日志 UserDailyDataFlow::where('node_id', '<>', 0) ->where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-1 month'))) + ->orWhere('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 month'))) ->delete(); - // 清除用户每天流量数据日志 - UserDailyDataFlow::where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 month')))->delete(); - // 清除节点每小时流量数据日志 NodeHourlyDataFlow::where('created_at', '<=', date('Y-m-d H:i:s', strtotime('-3 days')))->delete(); diff --git a/app/Console/Commands/AutoJob.php b/app/Console/Commands/AutoJob.php index 778e550b..4c04a17a 100644 --- a/app/Console/Commands/AutoJob.php +++ b/app/Console/Commands/AutoJob.php @@ -77,11 +77,12 @@ class AutoJob extends Command { // 注册验证码自动置无效 VerifyCode::recentUnused()->update(['status' => 2]); - // 优惠券到期自动置无效 - Coupon::whereStatus(0)->where('end_time', '<=', time())->update(['status' => 2]); - - // 用尽的优惠劵 - Coupon::whereStatus(0)->whereIn('type', [1, 2])->whereUsableTimes(0)->update(['status' => 2]); + // 优惠券到期 / 用尽的 自动置无效 + Coupon::whereStatus(0) + ->where('end_time', '<=', time()) + ->orWhereIn('type', [1, 2]) + ->whereUsableTimes(0) + ->update(['status' => 2]); // 邀请码到期自动置无效 Invite::whereStatus(0)->where('dateline', '<=', date('Y-m-d H:i:s'))->update(['status' => 2]); @@ -133,7 +134,7 @@ class AutoJob extends Command { private function blockUsers(): void { // 封禁1小时内流量异常账号 if(sysConfig('is_traffic_ban')){ - $userList = User::activeUser()->whereBanTime(0)->get(); + $userList = User::activeUser()->whereBanTime(null)->get(); foreach($userList as $user){ // 对管理员豁免 if($user->is_admin){ @@ -155,7 +156,7 @@ class AutoJob extends Command { } // 禁用流量超限用户 - $userList = User::activeUser()->whereBanTime(0)->whereRaw("u + d >= transfer_enable")->get(); + $userList = User::activeUser()->whereBanTime(null)->whereRaw("u + d >= transfer_enable")->get(); foreach($userList as $user){ $user->update(['enable' => 0]); @@ -167,10 +168,10 @@ class AutoJob extends Command { // 解封被临时封禁的账号 private function unblockUsers(): void { // 解封被临时封禁的账号 - $userList = User::whereEnable(0)->where('status', '>=', 0)->where('ban_time', '>', 0)->get(); + $userList = User::whereEnable(0)->where('status', '>=', 0)->whereNotNull('ban_time')->get(); foreach($userList as $user){ if($user->ban_time < time()){ - $user->update(['enable' => 1, 'ban_time' => 0]); + $user->update(['enable' => 1, 'ban_time' => null]); // 写入操作日志 $this->addUserBanLog($user->id, 0, '【自动解封】-临时封禁到期'); @@ -180,7 +181,7 @@ class AutoJob extends Command { // 可用流量大于已用流量也解封(比如:邀请返利自动加了流量) $userList = User::whereEnable(0) ->where('status', '>=', 0) - ->whereBanTime(0) + ->whereBanTime(null) ->where('expired_at', '>=', date('Y-m-d')) ->whereRaw("u + d < transfer_enable") ->get(); @@ -201,13 +202,10 @@ class AutoJob extends Command { $user->update(['port' => $port]); } - ## 被封禁的账号自动释放端口 - User::whereEnable(0)->whereStatus(-1)->where('port', '!=', 0)->update(['port' => 0]); - - ## 过期一个月的账户自动释放端口 - User::whereEnable(0) - ->where('port', '!=', 0) - ->where('expired_at', '<=', date("Y-m-d", strtotime("-1 months"))) + // 被封禁 / 过期一个月 的账号自动释放端口 + User::where('port', '<>', 0) + ->whereStatus(-1) + ->orWhere('expired_at', '<=', date("Y-m-d", strtotime("-1 months"))) ->update(['port' => 0]); } diff --git a/app/Console/Commands/DailyJob.php b/app/Console/Commands/DailyJob.php index cdf071c1..ef33ee5c 100644 --- a/app/Console/Commands/DailyJob.php +++ b/app/Console/Commands/DailyJob.php @@ -48,7 +48,7 @@ class DailyJob extends Command { 'transfer_enable' => 0, 'enable' => 0, 'reset_time' => null, - 'ban_time' => 0, + 'ban_time' => null, 'status' => -1 ]); @@ -66,7 +66,7 @@ class DailyJob extends Command { 'transfer_enable' => 0, 'enable' => 0, 'reset_time' => null, - 'ban_time' => 0 + 'ban_time' => null ]); $this->addUserBanLog($user->id, 0, '【封禁代理,清空账户】-账号已过期'); diff --git a/app/Console/Commands/UserTrafficAbnormalAutoWarning.php b/app/Console/Commands/UserTrafficAbnormalAutoWarning.php index 44eaa89a..b67bcffd 100644 --- a/app/Console/Commands/UserTrafficAbnormalAutoWarning.php +++ b/app/Console/Commands/UserTrafficAbnormalAutoWarning.php @@ -33,22 +33,18 @@ class UserTrafficAbnormalAutoWarning extends Command { ->groupBy('user_id') ->selectRaw("user_id, sum(total) as totalTraffic") ->get(); // 只统计100M以上的记录,加快查询速度 - if(!$userTotalTrafficList->isEmpty()){ - $title = "流量异常用户提醒"; - foreach($userTotalTrafficList as $vo){ - $user = User::find($vo->user_id); + foreach($userTotalTrafficList as $vo){ + $user = User::find($vo->user_id); - // 推送通知管理员 - if($vo->totalTraffic > sysConfig('traffic_ban_value') * GB){ - $traffic = UserHourlyDataFlow::userRecentUsed($user->id) - ->selectRaw("user_id, sum(`u`) as totalU, sum(`d`) as totalD, sum(total) as totalTraffic") - ->firstOrFail(); + // 推送通知管理员 + if($vo->totalTraffic > sysConfig('traffic_ban_value') * GB){ + $traffic = UserHourlyDataFlow::userRecentUsed($user->id) + ->selectRaw("user_id, sum(`u`) as totalU, sum(`d`) as totalD, sum(total) as totalTraffic") + ->first(); - $content = "用户**{$user->email}(ID:{$user->id})**,最近1小时**上行流量:".flowAutoShow($traffic->totalU).",下行流量:".flowAutoShow($traffic->totalD).",共计:".flowAutoShow($traffic->totalTraffic)."**。"; - - PushNotification::send($title, $content); - } + PushNotification::send("流量异常用户提醒", + "用户**{$user->email}(ID:{$user->id})**,最近1小时**上行流量:".flowAutoShow($traffic->totalU).",下行流量:".flowAutoShow($traffic->totalD).",共计:".flowAutoShow($traffic->totalTraffic)."**。"); } } } diff --git a/app/Console/Commands/UserTrafficAutoWarning.php b/app/Console/Commands/UserTrafficAutoWarning.php index 0f8a3999..86bd33d5 100644 --- a/app/Console/Commands/UserTrafficAutoWarning.php +++ b/app/Console/Commands/UserTrafficAutoWarning.php @@ -37,10 +37,7 @@ class UserTrafficAutoWarning extends Command { $usedPercent = round(($user->d + $user->u) / $user->transfer_enable, 2) * 100; // 已使用流量百分比 if($usedPercent >= sysConfig('traffic_warning_percent')){ - $title = '流量提醒'; - $content = '流量已使用:'.$usedPercent.'%,请保持关注。'; - - $logId = Helpers::addNotificationLog($title, $content, 1, $user->email); + $logId = Helpers::addNotificationLog("流量提醒", '流量已使用:'.$usedPercent.'%,请保持关注。', 1, $user->email); Mail::to($user->email)->send(new userTrafficWarning($logId, $usedPercent)); } } diff --git a/app/Http/Controllers/Admin/CouponController.php b/app/Http/Controllers/Admin/CouponController.php index 334dc4a6..e7ff4465 100644 --- a/app/Http/Controllers/Admin/CouponController.php +++ b/app/Http/Controllers/Admin/CouponController.php @@ -13,6 +13,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; use Redirect; use Response; +use Str; use Validator; /** @@ -98,7 +99,7 @@ class CouponController extends Controller { $obj = new Coupon(); $obj->name = $request->input('name'); $obj->logo = $logo; - $obj->sn = $num == 1 && $request->input('sn')? $request->input('sn') : makeRandStr(8); + $obj->sn = $num == 1 && $request->input('sn')? $request->input('sn') : Str::random(8); $obj->type = $type; $obj->usable_times = $request->input('usable_times'); $obj->value = $request->input('value'); diff --git a/app/Http/Controllers/Admin/SubscribeController.php b/app/Http/Controllers/Admin/SubscribeController.php index 9a4c8c6c..9daaeca4 100644 --- a/app/Http/Controllers/Admin/SubscribeController.php +++ b/app/Http/Controllers/Admin/SubscribeController.php @@ -68,7 +68,7 @@ class SubscribeController extends Controller { } if($status){ - UserSubscribe::find($id)->update(['status' => 1, 'ban_time' => 0, 'ban_desc' => '']); + UserSubscribe::find($id)->update(['status' => 1, 'ban_time' => null, 'ban_desc' => '']); }else{ UserSubscribe::find($id)->update(['status' => 0, 'ban_time' => time(), 'ban_desc' => '后台手动封禁']); } diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index aba6470c..8ab04b61 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -28,7 +28,6 @@ use App\Models\UserDataFlowLog; use App\Models\UserDataModifyLog; use App\Models\UserGroup; use App\Models\UserHourlyDataFlow; -use App\Models\UserSubscribe; use App\Services\UserService; use Auth; use DB; @@ -221,9 +220,9 @@ class AdminController extends Controller { $user = new User(); $user->username = $request->input('username'); $user->email = $request->input('email'); - $user->password = Hash::make($request->input('password')?: makeRandStr()); + $user->password = Hash::make($request->input('password')?: Str::random()); $user->port = $request->input('port')?: $this->makePort(); - $user->passwd = $request->input('passwd')?: makeRandStr(); + $user->passwd = $request->input('passwd')?: Str::random(); $user->vmess_id = $request->input('uuid')?: Str::uuid(); $user->transfer_enable = toGB($request->input('transfer_enable')?: 0); $user->enable = $request->input('enable')?: 0; @@ -244,12 +243,6 @@ class AdminController extends Controller { $user->save(); if($user->id){ - // 生成订阅码 - $subscribe = new UserSubscribe(); - $subscribe->user_id = $user->id; - $subscribe->code = Helpers::makeSubscribeCode(); - $subscribe->times = 0; - $subscribe->save(); // 写入用户流量变动记录 Helpers::addUserTrafficModifyLog($user->id, 0, 0, toGB($request->input('transfer_enable', 0)), @@ -283,17 +276,10 @@ class AdminController extends Controller { DB::beginTransaction(); for($i = 0; $i < $amount; $i++){ - $uid = Helpers::addUser('批量生成-'.makeRandStr(), Hash::make(makeRandStr()), toGB(1024), 365); + $uid = Helpers::addUser(Str::random(8).'@auto.generate', Hash::make(Str::random()), toGB(1024), 365); // 生成一个可用端口 if($uid){ - // 生成订阅码 - $subscribe = new UserSubscribe(); - $subscribe->user_id = $uid; - $subscribe->code = Helpers::makeSubscribeCode(); - $subscribe->times = 0; - $subscribe->save(); - // 写入用户流量变动记录 Helpers::addUserTrafficModifyLog($uid, 0, 0, toGB(1024), '后台批量生成用户'); } @@ -341,7 +327,7 @@ class AdminController extends Controller { 'username' => $request->input('username'), 'email' => $email, 'port' => $port, - 'passwd' => $request->input('passwd')?: makeRandStr(), + 'passwd' => $request->input('passwd')?: Str::random(), 'vmess_id' => $request->input('uuid')?: Str::uuid(), 'transfer_enable' => toGB($transfer_enable?: 0), 'enable' => $status < 0? 0 : $request->input('enable'), @@ -657,7 +643,7 @@ class AdminController extends Controller { } // 生成JSON文件 - $fileName = makeRandStr('16').'_shadowsocks.json'; + $fileName = Str::random().'_shadowsocks.json'; $filePath = public_path('downloads/'.$fileName); file_put_contents($filePath, $json); @@ -1147,7 +1133,7 @@ class AdminController extends Controller { $obj = new Invite(); $obj->inviter_id = 0; $obj->invitee_id = 0; - $obj->code = strtoupper(substr(md5(microtime().makeRandStr()), 8, 12)); + $obj->code = strtoupper(substr(md5(microtime().Str::random(6)), 8, 12)); $obj->status = 0; $obj->dateline = date('Y-m-d H:i:s', strtotime("+".self::$sysConfig['admin_invite_days']." days")); $obj->save(); diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index eb0e6b06..a4119305 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -12,7 +12,6 @@ use App\Models\EmailFilter; use App\Models\Invite; use App\Models\User; use App\Models\UserLoginLog; -use App\Models\UserSubscribe; use App\Models\Verify; use App\Models\VerifyCode; use App\Services\UserService; @@ -28,6 +27,7 @@ use Mail; use Redirect; use Response; use Session; +use Str; use Validator; /** @@ -351,13 +351,6 @@ class AuthController extends Controller { // 更新昵称 User::find($uid)->update(['username' => $username]); - // 生成订阅码 - $subscribe = new UserSubscribe(); - $subscribe->user_id = $uid; - $subscribe->code = Helpers::makeSubscribeCode(); - $subscribe->times = 0; - $subscribe->save(); - // 注册次数+1 if(Cache::has($cacheKey)){ Cache::increment($cacheKey); @@ -403,7 +396,7 @@ class AuthController extends Controller { } $view['emailList'] = self::$sysConfig['is_email_filtering'] != 2? false : EmailFilter::whereType(2)->get(); - Session::put('register_token', makeRandStr(16)); + Session::put('register_token', Str::random()); return Response::view('auth.register', $view); } @@ -773,7 +766,7 @@ class AuthController extends Controller { } // 发送邮件 - $code = makeRandStr(6, true); + $code = Str::random(6); $logId = Helpers::addNotificationLog('发送注册验证码', '验证码:'.$code, 1, $email); Mail::to($email)->send(new sendVerifyCode($logId, $code)); diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 6c2439cd..a13d4d3a 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -25,7 +25,7 @@ class Controller extends BaseController { // 生成随机密码 public function makePasswd() { - return makeRandStr(); + return Str::random(); } // 生成UUID @@ -35,7 +35,7 @@ class Controller extends BaseController { // 生成网站安全码 public function makeSecurityCode(): string { - return strtolower(makeRandStr(8)); + return strtolower(Str::random(8)); } // 类似Linux中的tail命令 @@ -109,7 +109,7 @@ class Controller extends BaseController { throw new RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); } - $fileName = makeRandStr(18, true).".{$type}"; + $fileName = Str::random(18).".{$type}"; if(file_put_contents(public_path($path.$fileName), base64_decode(str_replace($result[1], '', $base64_image_content)))){ chmod(public_path($path.$fileName), 0744); diff --git a/app/Http/Controllers/Gateway/AbstractPayment.php b/app/Http/Controllers/Gateway/AbstractPayment.php index 3551cc4b..bc43c2f1 100644 --- a/app/Http/Controllers/Gateway/AbstractPayment.php +++ b/app/Http/Controllers/Gateway/AbstractPayment.php @@ -7,6 +7,7 @@ use App\Models\Payment; use App\Models\PaymentCallback; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; +use Str; abstract class AbstractPayment { protected static $sysConfig; @@ -21,7 +22,7 @@ abstract class AbstractPayment { protected function creatNewPayment($uid, $oid, $amount): Payment { $payment = new Payment(); - $payment->trade_no = makeRandStr(8); + $payment->trade_no = Str::random(8); $payment->user_id = $uid; $payment->order_id = $oid; $payment->amount = $amount; diff --git a/app/Http/Controllers/NodeController.php b/app/Http/Controllers/NodeController.php index 1e59481e..48a4dac1 100644 --- a/app/Http/Controllers/NodeController.php +++ b/app/Http/Controllers/NodeController.php @@ -21,6 +21,7 @@ use Log; use Redirect; use Response; use Session; +use Str; use Validator; class NodeController extends Controller { @@ -402,8 +403,8 @@ class NodeController extends Controller { foreach(array_diff($nodeArray, $authArray) as $nodeId){ $obj = new NodeAuth(); $obj->node_id = $nodeId; - $obj->key = makeRandStr(16); - $obj->secret = makeRandStr(8); + $obj->key = Str::random(); + $obj->secret = Str::random(8); $obj->save(); } return Response::json(['status' => 'success', 'message' => '生成成功']); @@ -422,8 +423,8 @@ class NodeController extends Controller { // 重置节点授权 public function refreshAuth(Request $request): ?JsonResponse { $ret = NodeAuth::whereId($request->input('id'))->update([ - 'key' => makeRandStr(16), - 'secret' => makeRandStr(8) + 'key' => Str::random(), + 'secret' => Str::random(8) ]); if($ret){ return Response::json(['status' => 'success', 'message' => '操作成功']); diff --git a/app/Http/Controllers/User/SubscribeController.php b/app/Http/Controllers/User/SubscribeController.php index 2d5fea8e..8188378f 100644 --- a/app/Http/Controllers/User/SubscribeController.php +++ b/app/Http/Controllers/User/SubscribeController.php @@ -4,7 +4,6 @@ namespace App\Http\Controllers\User; use App\Components\Helpers; use App\Http\Controllers\Controller; -use App\Models\User; use App\Models\UserSubscribe; use App\Models\UserSubscribeLog; use Arr; @@ -38,7 +37,7 @@ class SubscribeController extends Controller { } // 检查用户是否有效 - $user = User::find($subscribe->user_id); + $user = $subscribe->user; if(!$user){ exit($this->infoGenerator('错误订阅链接,账号不存在!请前往官网重新获取订阅链接')); } @@ -49,7 +48,7 @@ class SubscribeController extends Controller { if($user->enable != 1){ $unusedTransfer = $user->transfer_enable - $user->u - $user->d; - if($user->ban_time > 0){ + if($user->ban_time){ exit($this->infoGenerator('您的账号处于封禁状态,请在'.date('Y-m-d H:i:s', $user->ban_time).'之后再更新!')); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 9c04fbff..f090b166 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -34,6 +34,7 @@ use Mail; use Redirect; use Response; use Session; +use Str; use Validator; /** @@ -67,11 +68,7 @@ class UserController extends Controller { $hourlyTraffic = UserHourlyDataFlow::userRecentUsed($user->id)->sum('total'); $view['isTrafficWarning'] = $hourlyTraffic >= (self::$sysConfig['traffic_ban_value'] * GB)?: 0; //付费用户判断 - $view['not_paying_user'] = Order::uid() - ->whereStatus(2) - ->whereIsExpire(0) - ->where('origin_amount', '>', 0) - ->doesntExist(); + $view['not_paying_user'] = Order::uid()->active()->where('origin_amount', '>', 0)->doesntExist(); $view['userLoginLog'] = UserLoginLog::whereUserId($user->id)->latest()->first(); // 近期登录日志 $view = array_merge($view, $this->dataFlowChart($user->id)); @@ -423,7 +420,7 @@ class UserController extends Controller { $obj = new Invite(); $obj->inviter_id = $user->id; $obj->invitee_id = 0; - $obj->code = strtoupper(mb_substr(md5(microtime().makeRandStr()), 8, 12)); + $obj->code = strtoupper(mb_substr(md5(microtime().Str::random()), 8, 12)); $obj->status = 0; $obj->dateline = date('Y-m-d H:i:s', strtotime("+".self::$sysConfig['user_invite_days']." days")); $obj->save(); @@ -540,7 +537,7 @@ class UserController extends Controller { Auth::getUser()->subscribe->update(['code' => Helpers::makeSubscribeCode()]); // 更换连接密码 - Auth::getUser()->update(['passwd' => makeRandStr()]); + Auth::getUser()->update(['passwd' => Str::random()]); DB::commit(); diff --git a/app/Models/EmailFilter.php b/app/Models/EmailFilter.php index 144199be..42b9e2be 100644 --- a/app/Models/EmailFilter.php +++ b/app/Models/EmailFilter.php @@ -10,4 +10,5 @@ use Illuminate\Database\Eloquent\Model; class EmailFilter extends Model { public $timestamps = false; protected $table = 'email_filter'; + protected $guarded = ['id']; } diff --git a/app/Models/Label.php b/app/Models/Label.php index d7ac7248..fab4b66a 100644 --- a/app/Models/Label.php +++ b/app/Models/Label.php @@ -11,6 +11,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; class Label extends Model { public $timestamps = false; protected $table = 'label'; + protected $guarded = ['id']; public function nodes(): HasMany { return $this->hasMany(NodeLabel::class); diff --git a/app/Models/Level.php b/app/Models/Level.php index 3009a425..70dd72f6 100644 --- a/app/Models/Level.php +++ b/app/Models/Level.php @@ -10,4 +10,5 @@ use Illuminate\Database\Eloquent\Model; class Level extends Model { public $timestamps = false; protected $table = 'level'; + protected $guarded = ['id']; } \ No newline at end of file diff --git a/app/Models/Rule.php b/app/Models/Rule.php index d81054b3..8bcb408e 100644 --- a/app/Models/Rule.php +++ b/app/Models/Rule.php @@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Model; class Rule extends Model { public $timestamps = false; protected $table = 'rule'; + protected $guarded = ['id']; public function getTypeLabelAttribute(): string { switch($this->attributes['type']){ diff --git a/app/Models/SsConfig.php b/app/Models/SsConfig.php index f003df4f..ed846b3b 100644 --- a/app/Models/SsConfig.php +++ b/app/Models/SsConfig.php @@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Model; class SsConfig extends Model { public $timestamps = false; protected $table = 'ss_config'; + protected $guarded = ['id']; // 筛选默认 diff --git a/app/Models/UserSubscribeLog.php b/app/Models/UserSubscribeLog.php index 451c137a..0ee9590f 100644 --- a/app/Models/UserSubscribeLog.php +++ b/app/Models/UserSubscribeLog.php @@ -15,7 +15,7 @@ class UserSubscribeLog extends Model { protected $table = 'user_subscribe_log'; public function subscribe(): BelongsTo { - return $this->belongsTo(UserSubscribe::class); + return $this->belongsTo(UserSubscribe::class, 'user_subscribe_id'); } public function user(): HasOneThrough { diff --git a/app/Observers/NodeObserver.php b/app/Observers/NodeObserver.php index 6b54ce9d..a210bfad 100644 --- a/app/Observers/NodeObserver.php +++ b/app/Observers/NodeObserver.php @@ -9,6 +9,7 @@ use App\Models\RuleGroup; use App\Models\UserGroup; use App\Services\NodeService; use Log; +use Str; class NodeObserver { public function saved(Node $node): void { @@ -18,8 +19,8 @@ class NodeObserver { public function created(Node $node): void { $auth = new NodeAuth(); $auth->node_id = $node->id; - $auth->key = makeRandStr(16); - $auth->secret = makeRandStr(8); + $auth->key = Str::random(); + $auth->secret = Str::random(8); if(!$auth->save()){ Log::error('节点生成-自动生成授权时出现错误,请稍后自行生成授权!'); } diff --git a/app/Observers/UserObserver.php b/app/Observers/UserObserver.php index db4c512a..bc2e5818 100644 --- a/app/Observers/UserObserver.php +++ b/app/Observers/UserObserver.php @@ -2,11 +2,13 @@ namespace App\Observers; +use App\Components\Helpers; use App\Jobs\VNet\addUser; use App\Jobs\VNet\delUser; use App\Jobs\VNet\editUser; use App\Models\Node; use App\Models\User; +use App\Models\UserSubscribe; use Arr; use DB; use Exception; @@ -14,6 +16,11 @@ use Log; class UserObserver { public function created(User $user): void { + $subscribe = new UserSubscribe(); + $subscribe->user_id = $user->id; + $subscribe->code = Helpers::makeSubscribeCode(); + $subscribe->save(); + $allowNodes = Node::userAllowNodes($user->group_id, $user->level)->whereType(4)->get(); if($allowNodes){ addUser::dispatch($user->id, $allowNodes); diff --git a/app/helpers.php b/app/helpers.php index 95026ae6..f435682a 100644 --- a/app/helpers.php +++ b/app/helpers.php @@ -15,25 +15,6 @@ define('Day', 86400); define('Mbps', 125000); -// 生成SS密码 -if(!function_exists('makeRandStr')){ - function makeRandStr($length = 6, $isNumbers = false) { - // 密码字符集,可任意添加你需要的字符 - if(!$isNumbers){ - $chars = 'abcdefghijkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ0123456789'; - }else{ - $chars = '0123456789'; - } - - $char = ''; - for($i = 0; $i < $length; $i++){ - $char .= $chars[random_int(0, strlen($chars) - 1)]; - } - - return $char; - } -} - // base64加密(处理URL) if(!function_exists('base64url_encode')){ function base64url_encode($data) { diff --git a/composer.json b/composer.json index 9b3528cf..d562dfa1 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,6 @@ "xhat/payjs": "^1.4" }, "require-dev": { - "roave/security-advisories": "dev-master", "barryvdh/laravel-debugbar": "^3", "beyondcode/laravel-dump-server": "^1.0", "filp/whoops": "^2.7", diff --git a/composer.lock b/composer.lock index f4302c1d..e939ec62 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "784754c9ce0836f2e81a227ea34d89b1", + "content-hash": "0df81e1d58ef2f2cc8365a3b3b9167ef", "packages": [ { "name": "bacon/bacon-qr-code", @@ -253,16 +253,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.7", + "version": "1.2.8", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" + "reference": "8a7ecad675253e4654ea05505233285377405215" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", - "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/8a7ecad675253e4654ea05505233285377405215", + "reference": "8a7ecad675253e4654ea05505233285377405215", "shasum": "", "mirrors": [ { @@ -311,7 +311,21 @@ "ssl", "tls" ], - "time": "2020-04-08T08:27:21+00:00" + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-08-23T12:54:47+00:00" }, { "name": "composer/composer", @@ -544,20 +558,34 @@ "spdx", "validator" ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], "time": "2020-07-15T15:35:07+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.2", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51" + "reference": "ebd27a9866ae8254e873866f795491f02418c5a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", - "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ebd27a9866ae8254e873866f795491f02418c5a5", + "reference": "ebd27a9866ae8254e873866f795491f02418c5a5", "shasum": "", "mirrors": [ { @@ -594,57 +622,21 @@ "Xdebug", "performance" ], - "time": "2020-06-04T11:16:35+00:00" - }, - { - "name": "cweagans/composer-patches", - "version": "1.6.7", - "source": { - "type": "git", - "url": "https://github.com/cweagans/composer-patches.git", - "reference": "2e6f72a2ad8d59cd7e2b729f218bf42adb14f590" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/2e6f72a2ad8d59cd7e2b729f218bf42adb14f590", - "reference": "2e6f72a2ad8d59cd7e2b729f218bf42adb14f590", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "require": { - "composer-plugin-api": "^1.0", - "php": ">=5.3.0" - }, - "require-dev": { - "composer/composer": "~1.0", - "phpunit/phpunit": "~4.6" - }, - "type": "composer-plugin", - "extra": { - "class": "cweagans\\Composer\\Patches" - }, - "autoload": { - "psr-4": { - "cweagans\\Composer\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ + "funding": [ { - "name": "Cameron Eagans", - "email": "me@cweagans.net" + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" } ], - "description": "Provides a way to patch Composer packages.", - "time": "2019-08-29T20:11:49+00:00" + "time": "2020-08-19T10:27:58+00:00" }, { "name": "dasprid/enum", @@ -820,6 +812,20 @@ "redis", "xcache" ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], "time": "2020-07-07T18:54:01+00:00" }, { @@ -920,6 +926,20 @@ "sqlserver", "sqlsrv" ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fdbal", + "type": "tidelift" + } + ], "time": "2020-04-20T17:19:26+00:00" }, { @@ -1100,6 +1120,20 @@ "uppercase", "words" ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], "time": "2020-05-29T07:19:59+00:00" }, { @@ -1168,6 +1202,20 @@ "parser", "php" ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", + "type": "tidelift" + } + ], "time": "2020-05-25T17:44:05+00:00" }, { @@ -1959,16 +2007,16 @@ }, { "name": "jaybizzle/crawler-detect", - "version": "v1.2.96", + "version": "v1.2.98", "source": { "type": "git", "url": "https://github.com/JayBizzle/Crawler-Detect.git", - "reference": "5a53c78644c54a628c3f5ead915c35b489c92239" + "reference": "02b24e5d4dc347737577f48c688ee14c3b5dfd4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/5a53c78644c54a628c3f5ead915c35b489c92239", - "reference": "5a53c78644c54a628c3f5ead915c35b489c92239", + "url": "https://api.github.com/repos/JayBizzle/Crawler-Detect/zipball/02b24e5d4dc347737577f48c688ee14c3b5dfd4f", + "reference": "02b24e5d4dc347737577f48c688ee14c3b5dfd4f", "shasum": "", "mirrors": [ { @@ -2010,7 +2058,7 @@ "crawlerdetect", "php crawler detect" ], - "time": "2020-06-14T20:37:24+00:00" + "time": "2020-08-20T18:36:15+00:00" }, { "name": "jenssegers/agent", @@ -2085,6 +2133,16 @@ "user agent", "useragent" ], + "funding": [ + { + "url": "https://github.com/jenssegers", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/jenssegers/agent", + "type": "tidelift" + } + ], "time": "2020-06-13T08:05:20+00:00" }, { @@ -2384,16 +2442,16 @@ }, { "name": "league/flysystem", - "version": "1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "6e96f54d82e71f71c4108da33ee96a7f57083710" + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/6e96f54d82e71f71c4108da33ee96a7f57083710", - "reference": "6e96f54d82e71f71c4108da33ee96a7f57083710", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9be3b16c877d477357c015cec057548cf9b2a14a", + "reference": "9be3b16c877d477357c015cec057548cf9b2a14a", "shasum": "", "mirrors": [ { @@ -2477,7 +2535,7 @@ "type": "other" } ], - "time": "2020-08-12T14:23:41+00:00" + "time": "2020-08-23T07:39:11+00:00" }, { "name": "league/mime-type-detection", @@ -2601,6 +2659,12 @@ "stream", "zip" ], + "funding": [ + { + "url": "https://opencollective.com/zipstream", + "type": "open_collective" + } + ], "time": "2020-05-30T13:11:16+00:00" }, { @@ -2781,16 +2845,16 @@ }, { "name": "mews/captcha", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/mewebstudio/captcha.git", - "reference": "cc4d745c4f7506be0b73ac70324f71408c7e3a80" + "reference": "700ce567b79d26b92f49704edfd1aeeb60940910" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mewebstudio/captcha/zipball/cc4d745c4f7506be0b73ac70324f71408c7e3a80", - "reference": "cc4d745c4f7506be0b73ac70324f71408c7e3a80", + "url": "https://api.github.com/repos/mewebstudio/captcha/zipball/700ce567b79d26b92f49704edfd1aeeb60940910", + "reference": "700ce567b79d26b92f49704edfd1aeeb60940910", "shasum": "", "mirrors": [ { @@ -2852,7 +2916,7 @@ "laravel6 Captcha", "laravel6 Security" ], - "time": "2020-03-21T08:52:58+00:00" + "time": "2020-08-21T15:58:16+00:00" }, { "name": "mews/purifier", @@ -3189,6 +3253,16 @@ "logging", "psr-3" ], + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], "time": "2020-07-23T08:35:51+00:00" }, { @@ -3245,16 +3319,16 @@ }, { "name": "nesbot/carbon", - "version": "2.38.0", + "version": "2.39.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "d8f6a6a91d1eb9304527b040500f61923e97674b" + "reference": "0a41ea7f7fedacf307b7a339800e10356a042918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d8f6a6a91d1eb9304527b040500f61923e97674b", - "reference": "d8f6a6a91d1eb9304527b040500f61923e97674b", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/0a41ea7f7fedacf307b7a339800e10356a042918", + "reference": "0a41ea7f7fedacf307b7a339800e10356a042918", "shasum": "", "mirrors": [ { @@ -3336,20 +3410,20 @@ "type": "tidelift" } ], - "time": "2020-08-04T19:12:46+00:00" + "time": "2020-08-24T12:35:58+00:00" }, { "name": "nikic/php-parser", - "version": "v4.8.0", + "version": "v4.9.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8c58eb4cd4f3883f82611abeac2efbc3dbed787e" + "reference": "aaee038b912e567780949787d5fe1977be11a778" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8c58eb4cd4f3883f82611abeac2efbc3dbed787e", - "reference": "8c58eb4cd4f3883f82611abeac2efbc3dbed787e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/aaee038b912e567780949787d5fe1977be11a778", + "reference": "aaee038b912e567780949787d5fe1977be11a778", "shasum": "", "mirrors": [ { @@ -3363,7 +3437,7 @@ "php": ">=7.0" }, "require-dev": { - "ircmaxell/php-yacc": "^0.0.6", + "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ @@ -3372,7 +3446,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8-dev" + "dev-master": "4.9-dev" } }, "autoload": { @@ -3394,7 +3468,7 @@ "parser", "php" ], - "time": "2020-08-09T10:23:20+00:00" + "time": "2020-08-18T19:48:01+00:00" }, { "name": "openlss/lib-array2xml", @@ -3887,20 +3961,30 @@ "php", "type" ], + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", + "type": "tidelift" + } + ], "time": "2020-07-20T17:29:33+00:00" }, { "name": "predis/predis", - "version": "v1.1.2", + "version": "v1.1.3", "source": { "type": "git", - "url": "https://github.com/predishq/predis.git", - "reference": "82eb18c6c3860849cb6e2ff34b0c4b39d5daee46" + "url": "https://github.com/predis/predis.git", + "reference": "2ce537d75e610550f5337e41b2a971417999b028" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/predishq/predis/zipball/82eb18c6c3860849cb6e2ff34b0c4b39d5daee46", - "reference": "82eb18c6c3860849cb6e2ff34b0c4b39d5daee46", + "url": "https://api.github.com/repos/predis/predis/zipball/2ce537d75e610550f5337e41b2a971417999b028", + "reference": "2ce537d75e610550f5337e41b2a971417999b028", "shasum": "", "mirrors": [ { @@ -3910,10 +3994,10 @@ ] }, "require": { - "cweagans/composer-patches": "^1.6", "php": ">=5.3.9" }, "require-dev": { + "cweagans/composer-patches": "^1.6", "phpunit/phpunit": "~4.8" }, "suggest": { @@ -3946,11 +4030,17 @@ { "name": "Daniele Alessandri", "email": "suppakilla@gmail.com", - "homepage": "http://clorophilla.net" + "homepage": "http://clorophilla.net", + "role": "Creator & Maintainer" + }, + { + "name": "Till Krüss", + "homepage": "https://till.im", + "role": "Maintainer" } ], "description": "Flexible and feature-complete Redis client for PHP and HHVM", - "homepage": "http://github.com/nrk/predis", + "homepage": "http://github.com/predis/predis", "keywords": [ "nosql", "predis", @@ -3958,15 +4048,11 @@ ], "funding": [ { - "url": "https://www.paypal.me/tillkruss", - "type": "custom" - }, - { - "url": "https://github.com/tillkruss", + "url": "https://github.com/sponsors/tillkruss", "type": "github" } ], - "time": "2020-08-11T17:28:15+00:00" + "time": "2020-08-18T21:00:59+00:00" }, { "name": "psr/container", @@ -4886,16 +4972,16 @@ }, { "name": "spatie/laravel-permission", - "version": "3.13.0", + "version": "3.16.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-permission.git", - "reference": "49b8063fbb9ec52ebef98cc6ec527a80d8853141" + "reference": "c5082ee84e0d128896b4a6864a8502d8c5f1df08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/49b8063fbb9ec52ebef98cc6ec527a80d8853141", - "reference": "49b8063fbb9ec52ebef98cc6ec527a80d8853141", + "url": "https://api.github.com/repos/spatie/laravel-permission/zipball/c5082ee84e0d128896b4a6864a8502d8c5f1df08", + "reference": "c5082ee84e0d128896b4a6864a8502d8c5f1df08", "shasum": "", "mirrors": [ { @@ -4905,14 +4991,14 @@ ] }, "require": { - "illuminate/auth": "^5.8|^6.0|^7.0", - "illuminate/container": "^5.8|^6.0|^7.0", - "illuminate/contracts": "^5.8|^6.0|^7.0", - "illuminate/database": "^5.8|^6.0|^7.0", + "illuminate/auth": "^5.8|^6.0|^7.0|^8.0", + "illuminate/container": "^5.8|^6.0|^7.0|^8.0", + "illuminate/contracts": "^5.8|^6.0|^7.0|^8.0", + "illuminate/database": "^5.8|^6.0|^7.0|^8.0", "php": "^7.2.5" }, "require-dev": { - "orchestra/testbench": "^3.8|^4.0|^5.0", + "orchestra/testbench": "^3.8|^4.0|^5.0|^6.0", "phpunit/phpunit": "^8.0|^9.0", "predis/predis": "^1.1" }, @@ -4956,7 +5042,13 @@ "security", "spatie" ], - "time": "2020-05-20T00:31:29+00:00" + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + } + ], + "time": "2020-08-18T17:14:06+00:00" }, { "name": "srmklive/paypal", @@ -5168,6 +5260,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-06T13:18:39+00:00" }, { @@ -5227,6 +5333,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-05-20T17:43:50+00:00" }, { @@ -5290,6 +5410,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-23T08:31:43+00:00" }, { @@ -5353,6 +5487,20 @@ ], "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-23T08:35:20+00:00" }, { @@ -5429,6 +5577,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-06-18T17:59:13+00:00" }, { @@ -5497,6 +5659,20 @@ "interoperability", "standards" ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-06T13:19:58+00:00" }, { @@ -5553,6 +5729,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-05-30T20:35:19+00:00" }, { @@ -5608,6 +5798,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-05T09:39:30+00:00" }, { @@ -5669,6 +5873,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-23T09:48:09+00:00" }, { @@ -5766,6 +5984,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-24T04:10:09+00:00" }, { @@ -5835,6 +6067,20 @@ "mime", "mime-type" ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-23T10:04:31+00:00" }, { @@ -6646,6 +6892,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-23T08:31:43+00:00" }, { @@ -6728,6 +6988,20 @@ "uri", "url" ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-05T09:39:30+00:00" }, { @@ -6796,6 +7070,20 @@ "interoperability", "standards" ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-06T13:23:11+00:00" }, { @@ -6878,6 +7166,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-23T08:31:43+00:00" }, { @@ -6945,6 +7247,20 @@ "interoperability", "standards" ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-07-06T13:23:11+00:00" }, { @@ -7028,6 +7344,20 @@ "debug", "dump" ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], "time": "2020-06-24T13:34:53+00:00" }, { @@ -7152,6 +7482,16 @@ "env", "environment" ], + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", + "type": "tidelift" + } + ], "time": "2020-07-14T19:04:52+00:00" }, { @@ -7403,6 +7743,20 @@ "constructor", "instantiate" ], + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], "time": "2020-05-29T17:27:14+00:00" }, { @@ -7774,6 +8128,12 @@ "object", "object graph" ], + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], "time": "2020-06-29T13:22:24+00:00" }, { @@ -7962,16 +8322,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.0", + "version": "5.2.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "3170448f5769fe19f456173d833734e0ff1b84df" + "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/3170448f5769fe19f456173d833734e0ff1b84df", - "reference": "3170448f5769fe19f456173d833734e0ff1b84df", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44", + "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44", "shasum": "", "mirrors": [ { @@ -8016,7 +8376,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-07-20T20:05:34+00:00" + "time": "2020-08-15T11:14:08+00:00" }, { "name": "phpspec/prophecy", @@ -8457,308 +8817,17 @@ "testing", "xunit" ], - "time": "2020-06-22T07:06:58+00:00" - }, - { - "name": "roave/security-advisories", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc", - "reference": "a9e4cf90fc47b0ffbb90ee79f24be1b7c5ce82dc", - "shasum": "", - "mirrors": [ - { - "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", - "preferred": true - } - ] - }, - "conflict": { - "3f/pygmentize": "<1.2", - "adodb/adodb-php": "<5.20.12", - "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", - "amphp/artax": "<1.0.6|>=2,<2.0.6", - "amphp/http": "<1.0.1", - "amphp/http-client": ">=4,<4.4", - "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", - "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", - "aws/aws-sdk-php": ">=3,<3.2.1", - "bagisto/bagisto": "<0.1.5", - "barrelstrength/sprout-base-email": "<1.2.7", - "barrelstrength/sprout-forms": "<3.9", - "bolt/bolt": "<3.7.1", - "brightlocal/phpwhois": "<=4.2.5", - "buddypress/buddypress": "<5.1.2", - "bugsnag/bugsnag-laravel": ">=2,<2.0.2", - "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.5.18|>=3.6,<3.6.15|>=3.7,<3.7.7", - "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", - "cartalyst/sentry": "<=2.1.6", - "centreon/centreon": "<18.10.8|>=19,<19.4.5", - "cesnet/simplesamlphp-module-proxystatistics": "<3.1", - "codeigniter/framework": "<=3.0.6", - "composer/composer": "<=1-alpha.11", - "contao-components/mediaelement": ">=2.14.2,<2.21.1", - "contao/core": ">=2,<3.5.39", - "contao/core-bundle": ">=4,<4.4.46|>=4.5,<4.8.6", - "contao/listing-bundle": ">=4,<4.4.8", - "datadog/dd-trace": ">=0.30,<0.30.2", - "david-garcia/phpwhois": "<=4.3.1", - "doctrine/annotations": ">=1,<1.2.7", - "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", - "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", - "doctrine/dbal": ">=2,<2.0.8|>=2.1,<2.1.2", - "doctrine/doctrine-bundle": "<1.5.2", - "doctrine/doctrine-module": "<=0.7.1", - "doctrine/mongodb-odm": ">=1,<1.0.2", - "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", - "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", - "dolibarr/dolibarr": "<11.0.4", - "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", - "drupal/drupal": ">=7,<7.72|>=8,<8.8.8|>=8.9,<8.9.1|>=9,<9.0.1", - "endroid/qr-code-bundle": "<3.4.2", - "enshrined/svg-sanitize": "<0.13.1", - "erusev/parsedown": "<1.7.2", - "ezsystems/demobundle": ">=5.4,<5.4.6.1", - "ezsystems/ezdemo-ls-extension": ">=5.4,<5.4.2.1", - "ezsystems/ezfind-ls": ">=5.3,<5.3.6.1|>=5.4,<5.4.11.1|>=2017.12,<2017.12.0.1", - "ezsystems/ezplatform": ">=1.7,<1.7.9.1|>=1.13,<1.13.5.1|>=2.5,<2.5.4", - "ezsystems/ezplatform-admin-ui": ">=1.3,<1.3.5|>=1.4,<1.4.6", - "ezsystems/ezplatform-admin-ui-assets": ">=4,<4.2", - "ezsystems/ezplatform-kernel": ">=1,<1.0.2.1", - "ezsystems/ezplatform-user": ">=1,<1.0.1", - "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.14.2|>=6,<6.7.9.1|>=6.8,<6.13.6.3|>=7,<7.2.4.1|>=7.3,<7.3.2.1|>=7.5,<7.5.7.1", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.14.1|>=2011,<2017.12.7.2|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3|>=2019.3,<2019.3.4.2", - "ezsystems/repository-forms": ">=2.3,<2.3.2.1", - "ezyang/htmlpurifier": "<4.1.1", - "firebase/php-jwt": "<2", - "fooman/tcpdf": "<6.2.22", - "fossar/tcpdf-parser": "<6.2.22", - "friendsofsymfony/oauth2-php": "<1.3", - "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", - "friendsoftypo3/mediace": ">=7.6.2,<7.6.5", - "fuel/core": "<1.8.1", - "getgrav/grav": "<1.7-beta.8", - "gos/web-socket-bundle": "<1.10.4|>=2,<2.6.1|>=3,<3.3", - "gree/jose": "<=2.2", - "gregwar/rst": "<1.0.3", - "guzzlehttp/guzzle": ">=4-rc.2,<4.2.4|>=5,<5.3.1|>=6,<6.2.1", - "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", - "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<=5.5.44|>=5.6,<5.6.30|>=6,<6.18.31|>=7,<7.22.4", - "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29|>=5.5,<=5.5.44|>=6,<6.18.34|>=7,<7.23.2", - "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", - "illuminate/view": ">=7,<7.1.2", - "ivankristianto/phpwhois": "<=4.3", - "james-heinrich/getid3": "<1.9.9", - "joomla/session": "<1.3.1", - "jsmitty12/phpwhois": "<5.1", - "kazist/phpwhois": "<=4.2.6", - "kitodo/presentation": "<3.1.2", - "kreait/firebase-php": ">=3.2,<3.8.1", - "la-haute-societe/tcpdf": "<6.2.22", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<=5.5.49|>=5.6,<5.6.30|>=6,<6.18.34|>=7,<7.23.2", - "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "league/commonmark": "<0.18.3", - "librenms/librenms": "<1.53", - "magento/community-edition": ">=2,<2.2.10|>=2.3,<2.3.3", - "magento/magento1ce": "<1.9.4.3", - "magento/magento1ee": ">=1,<1.14.4.3", - "magento/product-community-edition": ">=2,<2.2.10|>=2.3,<2.3.2-p.2", - "marcwillmann/turn": "<0.3.3", - "mittwald/typo3_forum": "<1.2.1", - "monolog/monolog": ">=1.8,<1.12", - "namshi/jose": "<2.2", - "nystudio107/craft-seomatic": "<3.3", - "nzo/url-encryptor-bundle": ">=4,<4.3.2|>=5,<5.0.1", - "october/backend": ">=1.0.319,<1.0.467", - "october/cms": ">=1.0.319,<1.0.466", - "october/october": ">=1.0.319,<1.0.466", - "october/rain": ">=1.0.319,<1.0.468", - "onelogin/php-saml": "<2.10.4", - "oneup/uploader-bundle": "<1.9.3|>=2,<2.1.5", - "openid/php-openid": "<2.3", - "oro/crm": ">=1.7,<1.7.4", - "oro/platform": ">=1.7,<1.7.4", - "padraic/humbug_get_contents": "<1.1.2", - "pagarme/pagarme-php": ">=0,<3", - "paragonie/random_compat": "<2", - "paypal/merchant-sdk-php": "<3.12", - "pear/archive_tar": "<1.4.4", - "phpfastcache/phpfastcache": ">=5,<5.0.13", - "phpmailer/phpmailer": "<6.1.6", - "phpmussel/phpmussel": ">=1,<1.6", - "phpmyadmin/phpmyadmin": "<4.9.2", - "phpoffice/phpexcel": "<1.8.2", - "phpoffice/phpspreadsheet": "<1.8", - "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", - "phpwhois/phpwhois": "<=4.2.5", - "phpxmlrpc/extras": "<0.6.1", - "pimcore/pimcore": "<6.3", - "prestashop/autoupgrade": ">=4,<4.10.1", - "prestashop/gamification": "<2.3.2", - "prestashop/ps_facetedsearch": "<3.4.1", - "privatebin/privatebin": "<1.2.2|>=1.3,<1.3.2", - "propel/propel": ">=2-alpha.1,<=2-alpha.7", - "propel/propel1": ">=1,<=1.7.1", - "pusher/pusher-php-server": "<2.2.1", - "rainlab/debugbar-plugin": "<3.1", - "robrichards/xmlseclibs": "<3.0.4", - "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "scheb/two-factor-bundle": ">=0,<3.26|>=4,<4.11", - "sensiolabs/connect": "<4.2.3", - "serluck/phpwhois": "<=4.2.6", - "shopware/shopware": "<5.3.7", - "silverstripe/admin": ">=1.0.3,<1.0.4|>=1.1,<1.1.1", - "silverstripe/assets": ">=1,<1.4.7|>=1.5,<1.5.2", - "silverstripe/cms": "<4.3.6|>=4.4,<4.4.4", - "silverstripe/comments": ">=1.3,<1.9.99|>=2,<2.9.99|>=3,<3.1.1", - "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<4.4.7|>=4.5,<4.5.4", - "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.1.2|>=3.2,<3.2.4", - "silverstripe/registry": ">=2.1,<2.1.2|>=2.2,<2.2.1", - "silverstripe/restfulserver": ">=1,<1.0.9|>=2,<2.0.4", - "silverstripe/subsites": ">=2,<2.1.1", - "silverstripe/taxonomy": ">=1.3,<1.3.1|>=2,<2.0.1", - "silverstripe/userforms": "<3", - "simple-updates/phpwhois": "<=1", - "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.18.6", - "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", - "simplito/elliptic-php": "<1.0.6", - "slim/slim": "<2.6", - "smarty/smarty": "<3.1.33", - "socalnick/scn-social-auth": "<1.15.2", - "spoonity/tcpdf": "<6.2.22", - "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", - "ssddanbrown/bookstack": "<0.29.2", - "stormpath/sdk": ">=0,<9.9.99", - "studio-42/elfinder": "<2.1.49", - "sulu/sulu": "<1.6.34|>=2,<2.0.10|>=2.1,<2.1.1", - "swiftmailer/swiftmailer": ">=4,<5.4.5", - "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", - "sylius/grid": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/grid-bundle": ">=1,<1.1.19|>=1.2,<1.2.18|>=1.3,<1.3.13|>=1.4,<1.4.5|>=1.5,<1.5.1", - "sylius/resource-bundle": "<1.3.13|>=1.4,<1.4.6|>=1.5,<1.5.1|>=1.6,<1.6.3", - "sylius/sylius": "<1.3.16|>=1.4,<1.4.12|>=1.5,<1.5.9|>=1.6,<1.6.5", - "symbiote/silverstripe-multivaluefield": ">=3,<3.0.99", - "symbiote/silverstripe-versionedfiles": "<=2.0.3", - "symfony/cache": ">=3.1,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/dependency-injection": ">=2,<2.0.17|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/error-handler": ">=4.4,<4.4.4|>=5,<5.0.4", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", - "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2|>=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/http-foundation": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/http-kernel": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8", - "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", - "symfony/mime": ">=4.3,<4.3.8", - "symfony/phpunit-bridge": ">=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/polyfill": ">=1,<1.10", - "symfony/polyfill-php55": ">=1,<1.10", - "symfony/proxy-manager-bridge": ">=2.7,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7", - "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.1.12|>=4.2,<4.2.7|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", - "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.51|>=2.8,<2.8.50|>=3,<3.4.26|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.8.52|>=3,<3.4.35|>=4,<4.2.12|>=4.3,<4.3.8|>=4.4,<4.4.7|>=5,<5.0.7", - "symfony/translation": ">=2,<2.0.17", - "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/var-exporter": ">=4.2,<4.2.12|>=4.3,<4.3.8", - "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", - "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", - "t3g/svg-sanitizer": "<1.0.3", - "tecnickcom/tcpdf": "<6.2.22", - "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1-beta.1,<2.1.3", - "theonedemon/phpwhois": "<=4.2.5", - "titon/framework": ">=0,<9.9.99", - "truckersmp/phpwhois": "<=4.3.1", - "twig/twig": "<1.38|>=2,<2.7", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", - "typo3/cms-core": ">=8,<8.7.30|>=9,<9.5.20|>=10,<10.4.6", - "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", - "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", - "typo3/phar-stream-wrapper": ">=1,<2.1.1|>=3,<3.1.1", - "ua-parser/uap-php": "<3.8", - "usmanhalalit/pixie": "<1.0.3|>=2,<2.0.2", - "verot/class.upload.php": "<=1.0.3|>=2,<=2.0.4", - "wallabag/tcpdf": "<6.2.22", - "willdurand/js-translation-bundle": "<2.1.1", - "yii2mod/yii2-cms": "<1.9.2", - "yiisoft/yii": ">=1.1.14,<1.1.15", - "yiisoft/yii2": "<2.0.15", - "yiisoft/yii2-bootstrap": "<2.0.4", - "yiisoft/yii2-dev": "<2.0.15", - "yiisoft/yii2-elasticsearch": "<2.0.5", - "yiisoft/yii2-gii": "<2.0.4", - "yiisoft/yii2-jui": "<2.0.4", - "yiisoft/yii2-redis": "<2.0.8", - "yourls/yourls": "<1.7.4", - "zendframework/zend-cache": ">=2.4,<2.4.8|>=2.5,<2.5.3", - "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", - "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-developer-tools": ">=1.2.2,<1.2.3", - "zendframework/zend-diactoros": ">=1,<1.8.4", - "zendframework/zend-feed": ">=1,<2.10.3", - "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=1,<2.8.1", - "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", - "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", - "zendframework/zend-navigation": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-session": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.9|>=2.3,<2.3.4", - "zendframework/zend-validator": ">=2.3,<2.3.6", - "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": "<2.5.1", - "zendframework/zendframework1": "<1.12.20", - "zendframework/zendopenid": ">=2,<2.0.2", - "zendframework/zendxml": ">=1,<1.0.1", - "zetacomponents/mail": "<1.8.2", - "zf-commons/zfc-user": "<1.2.2", - "zfcampus/zf-apigility-doctrine": ">=1,<1.0.3", - "zfr/zfr-oauth2-server-module": "<0.1.2" - }, - "type": "metapackage", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "role": "maintainer" - }, - { - "name": "Ilya Tribusean", - "email": "slash3b@gmail.com", - "role": "maintainer" - } - ], - "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "funding": [ { - "url": "https://github.com/Ocramius", - "type": "github" + "url": "https://phpunit.de/donate.html", + "type": "custom" }, { - "url": "https://tidelift.com/funding/github/packagist/roave/security-advisories", - "type": "tidelift" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "time": "2020-08-08T10:05:44+00:00" + "time": "2020-06-22T07:06:58+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -9491,6 +9560,12 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], "time": "2020-07-12T23:59:07+00:00" }, { @@ -9551,14 +9626,13 @@ ], "aliases": [], "minimum-stability": "dev", - "stability-flags": { - "roave/security-advisories": 20 - }, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^7.2", - "ext-json": "*" + "ext-json": "*", + "ext-openssl": "*" }, "platform-dev": [], "plugin-api-version": "1.1.0" diff --git a/database/migrations/2020_08_21_145711_create_article_table.php b/database/migrations/2020_08_21_145711_create_article_table.php new file mode 100644 index 00000000..4ca1aaa4 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_article_table.php @@ -0,0 +1,36 @@ +increments('id'); + $table->boolean('type')->default(1)->comment('类型:1-文章、2-站内公告、3-站外公告'); + $table->string('title', 100)->comment('标题'); + $table->string('summary')->nullable()->comment('简介'); + $table->string('logo')->nullable()->comment('LOGO'); + $table->text('content')->nullable()->comment('内容'); + $table->unsignedTinyInteger('sort')->default(0)->comment('排序'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + $table->softDeletes()->comment('删除时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('article'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_config_table.php b/database/migrations/2020_08_21_145711_create_config_table.php new file mode 100644 index 00000000..fcf8a5d9 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_config_table.php @@ -0,0 +1,28 @@ +string('name')->primary()->comment('配置名'); + $table->text('value')->nullable()->comment('配置值'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('config'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_country_table.php b/database/migrations/2020_08_21_145711_create_country_table.php new file mode 100644 index 00000000..a30a3ecd --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_country_table.php @@ -0,0 +1,28 @@ +char('code', 2)->primary()->comment('ISO国家代码'); + $table->string('name', 10)->comment('名称'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('country'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_coupon_log_table.php b/database/migrations/2020_08_21_145711_create_coupon_log_table.php new file mode 100644 index 00000000..e7329d96 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_coupon_log_table.php @@ -0,0 +1,32 @@ +increments('id'); + $table->unsignedInteger('coupon_id')->default(0)->comment('优惠券ID'); + $table->unsignedInteger('goods_id')->default(0)->comment('商品ID'); + $table->unsignedInteger('order_id')->default(0)->comment('订单ID'); + $table->string('description', 50)->nullable()->comment('备注'); + $table->dateTime('created_at')->comment('创建时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('coupon_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_coupon_table.php b/database/migrations/2020_08_21_145711_create_coupon_table.php new file mode 100644 index 00000000..1328d17f --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_coupon_table.php @@ -0,0 +1,40 @@ +increments('id'); + $table->string('name', 50)->comment('优惠券名称'); + $table->string('logo')->nullable()->comment('优惠券LOGO'); + $table->string('sn', 50)->unique()->comment('优惠券码'); + $table->boolean('type')->default(1)->comment('类型:1-抵用券、2-折扣券、3-充值券'); + $table->unsignedSmallInteger('usable_times')->nullable()->comment('可使用次数'); + $table->unsignedInteger('value')->comment('折扣金额(元)/折扣力度'); + $table->unsignedInteger('rule')->nullable()->comment('使用限制(元)'); + $table->unsignedInteger('start_time')->default(0)->comment('有效期开始'); + $table->unsignedInteger('end_time')->default(0)->comment('有效期结束'); + $table->boolean('status')->default(0)->comment('状态:0-未使用、1-已使用、2-已失效'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + $table->softDeletes()->comment('删除时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('coupon'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_email_filter_table.php b/database/migrations/2020_08_21_145711_create_email_filter_table.php new file mode 100644 index 00000000..74c5ae6b --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_email_filter_table.php @@ -0,0 +1,29 @@ +increments('id'); + $table->boolean('type')->default(1)->comment('类型:1-黑名单、2-白名单'); + $table->string('words', 50)->comment('敏感词'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('email_filter'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_failed_jobs_table.php b/database/migrations/2020_08_21_145711_create_failed_jobs_table.php new file mode 100644 index 00000000..9805670d --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_failed_jobs_table.php @@ -0,0 +1,32 @@ +bigIncrements('id'); + $table->text('connection'); + $table->text('queue'); + $table->longText('payload'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('failed_jobs'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_goods_table.php b/database/migrations/2020_08_21_145711_create_goods_table.php new file mode 100644 index 00000000..c1cace36 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_goods_table.php @@ -0,0 +1,47 @@ +increments('id'); + $table->string('name', 100)->comment('商品名称'); + $table->string('logo')->nullable()->comment('商品图片地址'); + $table->unsignedBigInteger('traffic')->default(0)->comment('商品内含多少流量,单位MiB'); + $table->boolean('type')->default(1)->comment('商品类型:1-流量包、2-套餐'); + $table->unsignedInteger('price')->default(0)->comment('售价,单位分'); + $table->unsignedTinyInteger('level')->default(0)->comment('购买后给用户授权的等级'); + $table->unsignedInteger('renew')->nullable()->comment('流量重置价格,单位分'); + $table->unsignedInteger('period')->nullable()->comment('流量自动重置周期'); + $table->string('info')->nullable()->comment('商品信息'); + $table->string('description')->nullable()->comment('商品描述'); + $table->unsignedInteger('days')->default(30)->comment('有效期'); + $table->unsignedInteger('invite_num')->nullable()->comment('赠送邀请码数'); + $table->unsignedInteger('limit_num')->nullable()->comment('限购数量,默认为null不限购'); + $table->string('color', 50)->default('green')->comment('商品颜色'); + $table->unsignedTinyInteger('sort')->default(0)->comment('排序'); + $table->boolean('is_hot')->default(0)->comment('是否热销:0-否、1-是'); + $table->boolean('status')->default(0)->comment('状态:0-下架、1-上架'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + $table->softDeletes()->comment('删除时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('goods'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_invite_table.php b/database/migrations/2020_08_21_145711_create_invite_table.php new file mode 100644 index 00000000..38700794 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_invite_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->unsignedInteger('inviter_id')->default(0)->comment('邀请ID'); + $table->unsignedInteger('invitee_id')->nullable()->comment('受邀ID'); + $table->char('code', 12)->unique()->comment('邀请码'); + $table->boolean('status')->default(0)->comment('邀请码状态:0-未使用、1-已使用、2-已过期'); + $table->dateTime('dateline')->comment('有效期至'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + $table->softDeletes()->comment('删除时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('invite'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_jobs_table.php b/database/migrations/2020_08_21_145711_create_jobs_table.php new file mode 100644 index 00000000..2c8636b1 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_jobs_table.php @@ -0,0 +1,33 @@ +bigIncrements('id'); + $table->string('queue')->index(); + $table->longText('payload'); + $table->unsignedTinyInteger('attempts'); + $table->unsignedInteger('reserved_at')->nullable(); + $table->unsignedInteger('available_at'); + $table->unsignedInteger('created_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('jobs'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_label_table.php b/database/migrations/2020_08_21_145711_create_label_table.php new file mode 100644 index 00000000..8322a977 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_label_table.php @@ -0,0 +1,29 @@ +increments('id'); + $table->string('name')->comment('名称'); + $table->unsignedTinyInteger('sort')->default(0)->comment('排序值'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('label'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_level_table.php b/database/migrations/2020_08_21_145711_create_level_table.php new file mode 100644 index 00000000..4b3b5a6d --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_level_table.php @@ -0,0 +1,29 @@ +increments('id'); + $table->unsignedTinyInteger('level')->comment('等级'); + $table->string('name', 100)->comment('等级名称'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('level'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_marketing_table.php b/database/migrations/2020_08_21_145711_create_marketing_table.php new file mode 100644 index 00000000..4ffa50ff --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_marketing_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->boolean('type')->comment('类型:1-邮件群发'); + $table->text('receiver')->comment('接收者'); + $table->string('title')->comment('标题'); + $table->text('content')->comment('内容'); + $table->string('error')->nullable()->comment('错误信息'); + $table->boolean('status')->comment('状态:-1-失败、0-待发送、1-成功'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('marketing'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_node_auth_table.php b/database/migrations/2020_08_21_145711_create_node_auth_table.php new file mode 100644 index 00000000..c2060076 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_node_auth_table.php @@ -0,0 +1,32 @@ +increments('id'); + $table->unsignedInteger('node_id')->comment('授权节点ID'); + $table->char('key', 16)->comment('认证KEY'); + $table->char('secret', 8)->comment('通信密钥'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('node_auth'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_node_certificate_table.php b/database/migrations/2020_08_21_145711_create_node_certificate_table.php new file mode 100644 index 00000000..2944197c --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_node_certificate_table.php @@ -0,0 +1,32 @@ +increments('id'); + $table->string('domain')->comment('域名'); + $table->text('key')->nullable()->comment('域名证书KEY'); + $table->text('pem')->nullable()->comment('域名证书PEM'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('node_certificate'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_node_daily_data_flow_table.php b/database/migrations/2020_08_21_145711_create_node_daily_data_flow_table.php new file mode 100644 index 00000000..1db58a03 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_node_daily_data_flow_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->unsignedInteger('node_id')->default(0)->index()->comment('节点ID'); + $table->unsignedBigInteger('u')->default(0)->comment('上传流量'); + $table->unsignedBigInteger('d')->default(0)->comment('下载流量'); + $table->unsignedBigInteger('total')->default(0)->comment('总流量'); + $table->string('traffic')->nullable()->comment('总流量(带单位)'); + $table->dateTime('created_at')->comment('创建时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('node_daily_data_flow'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_node_hourly_data_flow_table.php b/database/migrations/2020_08_21_145711_create_node_hourly_data_flow_table.php new file mode 100644 index 00000000..a3967ff9 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_node_hourly_data_flow_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->unsignedInteger('node_id')->default(0)->index()->comment('节点ID'); + $table->unsignedBigInteger('u')->default(0)->comment('上传流量'); + $table->unsignedBigInteger('d')->default(0)->comment('下载流量'); + $table->unsignedBigInteger('total')->default(0)->comment('总流量'); + $table->string('traffic')->nullable()->comment('总流量(带单位)'); + $table->dateTime('created_at')->comment('创建时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('node_hourly_data_flow'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_node_label_table.php b/database/migrations/2020_08_21_145711_create_node_label_table.php new file mode 100644 index 00000000..48491341 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_node_label_table.php @@ -0,0 +1,30 @@ +increments('id'); + $table->unsignedInteger('node_id')->default(0)->comment('节点ID'); + $table->unsignedInteger('label_id')->default(0)->comment('标签ID'); + $table->index(['node_id', 'label_id'], 'idx_node_label'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('node_label'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_node_ping_table.php b/database/migrations/2020_08_21_145711_create_node_ping_table.php new file mode 100644 index 00000000..3728ba08 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_node_ping_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->unsignedInteger('node_id')->default(0)->index()->comment('对应节点id'); + $table->integer('ct')->default(0)->comment('电信'); + $table->integer('cu')->default(0)->comment('联通'); + $table->integer('cm')->default(0)->comment('移动'); + $table->integer('hk')->default(0)->comment('香港'); + $table->dateTime('created_at')->comment('创建时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('node_ping'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_node_rule_table.php b/database/migrations/2020_08_21_145711_create_node_rule_table.php new file mode 100644 index 00000000..9e73ecdd --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_node_rule_table.php @@ -0,0 +1,32 @@ +increments('id'); + $table->unsignedInteger('node_id')->nullable()->comment('节点ID'); + $table->unsignedInteger('rule_id')->nullable()->comment('审计规则ID'); + $table->boolean('is_black')->default(1)->comment('是否黑名单模式:0-不是、1-是'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('node_rule'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_notification_log_table.php b/database/migrations/2020_08_21_145711_create_notification_log_table.php new file mode 100644 index 00000000..bcb86f45 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_notification_log_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->boolean('type')->default(1)->comment('类型:1-邮件、2-ServerChan、3-Bark、4-Telegram'); + $table->string('address')->comment('收信地址'); + $table->string('title')->comment('标题'); + $table->text('content')->comment('内容'); + $table->boolean('status')->default(0)->comment('状态:-1发送失败、0-等待发送、1-发送成功'); + $table->text('error')->nullable()->comment('发送失败抛出的异常信息'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('notification_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_order_table.php b/database/migrations/2020_08_21_145711_create_order_table.php new file mode 100644 index 00000000..f1e1d867 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_order_table.php @@ -0,0 +1,41 @@ +increments('id'); + $table->string('order_sn', 20)->comment('订单编号'); + $table->unsignedInteger('user_id')->comment('操作人'); + $table->unsignedInteger('goods_id')->nullable()->comment('商品ID'); + $table->unsignedInteger('coupon_id')->nullable()->comment('优惠券ID'); + $table->unsignedInteger('origin_amount')->default(0)->comment('订单原始总价,单位分'); + $table->unsignedInteger('amount')->default(0)->comment('订单总价,单位分'); + $table->dateTime('expired_at')->nullable()->comment('过期时间'); + $table->boolean('is_expire')->default(0)->comment('是否已过期:0-未过期、1-已过期'); + $table->boolean('pay_type')->default(0)->comment('支付渠道:0-余额、1-支付宝、2-QQ、3-微信、4-虚拟货币、5-paypal'); + $table->string('pay_way', 10)->default('balance')->comment('支付方式:balance、f2fpay、codepay、payjs、bitpayx等'); + $table->boolean('status')->default(0)->comment('订单状态:-1-已关闭、0-待支付、1-已支付待确认、2-已完成'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + $table->index(['user_id', 'goods_id', 'is_expire', 'status'], 'idx_order_search'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('order'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_payment_callback_table.php b/database/migrations/2020_08_21_145711_create_payment_callback_table.php new file mode 100644 index 00000000..83a1edd9 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_payment_callback_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->string('trade_no', 64)->comment('本地订单号'); + $table->string('out_trade_no', 64)->comment('外部订单号(支付平台)'); + $table->unsignedInteger('amount')->comment('交易金额,单位分'); + $table->boolean('status')->comment('交易状态:0-失败、1-成功'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('payment_callback'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_payment_table.php b/database/migrations/2020_08_21_145711_create_payment_table.php new file mode 100644 index 00000000..67640982 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_payment_table.php @@ -0,0 +1,36 @@ +increments('id'); + $table->string('trade_no', 64)->comment('支付单号(本地订单号)'); + $table->unsignedInteger('user_id')->comment('用户ID'); + $table->unsignedInteger('order_id')->comment('本地订单ID'); + $table->unsignedInteger('amount')->default(0)->comment('金额,单位分'); + $table->text('qr_code')->nullable()->comment('支付二维码'); + $table->text('url')->nullable()->comment('支付链接'); + $table->boolean('status')->default(0)->comment('支付状态:-1-支付失败、0-等待支付、1-支付成功'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('payment'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_products_pool_table.php b/database/migrations/2020_08_21_145711_create_products_pool_table.php new file mode 100644 index 00000000..9af466bd --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_products_pool_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->string('name')->comment('名称'); + $table->unsignedInteger('min_amount')->default(0)->comment('适用最小金额,单位分'); + $table->unsignedInteger('max_amount')->default(0)->comment('适用最大金额,单位分'); + $table->boolean('status')->default(1)->comment('状态:0-未启用、1-已启用'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('products_pool'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_referral_apply_table.php b/database/migrations/2020_08_21_145711_create_referral_apply_table.php new file mode 100644 index 00000000..fda9acd9 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_referral_apply_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->unsignedInteger('user_id')->comment('用户ID'); + $table->unsignedInteger('before')->default(0)->comment('操作前可提现金额,单位分'); + $table->unsignedInteger('after')->default(0)->comment('操作后可提现金额,单位分'); + $table->unsignedInteger('amount')->default(0)->comment('本次提现金额,单位分'); + $table->json('link_logs')->comment('关联返利日志ID,例如:1,3,4'); + $table->boolean('status')->default(0)->comment('状态:-1-驳回、0-待审核、1-审核通过待打款、2-已打款'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('referral_apply'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_referral_log_table.php b/database/migrations/2020_08_21_145711_create_referral_log_table.php new file mode 100644 index 00000000..af4a2f13 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_referral_log_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->unsignedInteger('invitee_id')->comment('用户ID'); + $table->unsignedInteger('inviter_id')->comment('推广人ID'); + $table->unsignedInteger('order_id')->comment('关联订单ID'); + $table->unsignedInteger('amount')->comment('消费金额,单位分'); + $table->unsignedInteger('commission')->comment('返利金额'); + $table->boolean('status')->default(0)->comment('状态:0-未提现、1-审核中、2-已提现'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('referral_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_rule_group_node_table.php b/database/migrations/2020_08_21_145711_create_rule_group_node_table.php new file mode 100644 index 00000000..16c3dca7 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_rule_group_node_table.php @@ -0,0 +1,31 @@ +increments('id'); + $table->unsignedInteger('rule_group_id')->comment('规则分组ID'); + $table->unsignedInteger('node_id')->comment('节点ID'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('rule_group_node'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_rule_group_table.php b/database/migrations/2020_08_21_145711_create_rule_group_table.php new file mode 100644 index 00000000..a10ed73f --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_rule_group_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->boolean('type')->default(1)->comment('模式:1-阻断、0-放行'); + $table->string('name')->comment('分组名称'); + $table->json('rules')->nullable()->comment('关联的规则ID,多个用,号分隔'); + $table->json('nodes')->nullable()->comment('关联的节点ID,多个用,号分隔'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('rule_group'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_rule_log_table.php b/database/migrations/2020_08_21_145711_create_rule_log_table.php new file mode 100644 index 00000000..26bd95e7 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_rule_log_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->unsignedInteger('user_id')->default(0)->comment('用户ID'); + $table->unsignedInteger('node_id')->default(0)->comment('节点ID'); + $table->unsignedInteger('rule_id')->default(0)->comment('规则ID,0表示白名单模式下访问访问了非规则允许的网址'); + $table->string('reason')->nullable()->comment('触发原因'); + $table->dateTime('created_at')->comment('创建时间'); + $table->index(['user_id', 'node_id', 'rule_id'], 'idx'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('rule_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_rule_table.php b/database/migrations/2020_08_21_145711_create_rule_table.php new file mode 100644 index 00000000..e875fabb --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_rule_table.php @@ -0,0 +1,30 @@ +increments('id'); + $table->boolean('type')->default(1)->comment('类型:1-正则表达式、2-域名、3-IP、4-协议'); + $table->string('name', 100)->comment('规则描述'); + $table->text('pattern')->comment('规则值'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('rule'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_ss_config_table.php b/database/migrations/2020_08_21_145711_create_ss_config_table.php new file mode 100644 index 00000000..a2037f71 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_ss_config_table.php @@ -0,0 +1,31 @@ +increments('id'); + $table->string('name', 50)->comment('配置名'); + $table->boolean('type')->default(1)->comment('类型:1-加密方式、2-协议、3-混淆'); + $table->boolean('is_default')->default(0)->comment('是否默认:0-不是、1-是'); + $table->unsignedTinyInteger('sort')->default(0)->comment('排序:值越大排越前'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('ss_config'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_ss_node_info_table.php b/database/migrations/2020_08_21_145711_create_ss_node_info_table.php new file mode 100644 index 00000000..23fa2be2 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_ss_node_info_table.php @@ -0,0 +1,31 @@ +increments('id'); + $table->unsignedInteger('node_id')->default(0)->index()->comment('节点ID'); + $table->unsignedInteger('uptime')->comment('后端存活时长,单位秒'); + $table->string('load')->comment('负载'); + $table->unsignedInteger('log_time')->comment('记录时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('ss_node_info'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_ss_node_ip_table.php b/database/migrations/2020_08_21_145711_create_ss_node_ip_table.php new file mode 100644 index 00000000..644becee --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_ss_node_ip_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->unsignedInteger('node_id')->default(0)->index()->comment('节点ID'); + $table->unsignedInteger('user_id')->default(0)->index()->comment('用户ID'); + $table->unsignedSmallInteger('port')->default(0)->index()->comment('端口'); + $table->char('type', 3)->default('tcp')->comment('类型:all、tcp、udp'); + $table->text('ip')->nullable()->comment('连接IP:每个IP用,号隔开'); + $table->unsignedInteger('created_at')->default(0)->comment('上报时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('ss_node_ip'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_ss_node_online_log_table.php b/database/migrations/2020_08_21_145711_create_ss_node_online_log_table.php new file mode 100644 index 00000000..7b1a7cbb --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_ss_node_online_log_table.php @@ -0,0 +1,30 @@ +increments('id'); + $table->unsignedInteger('node_id')->index()->comment('节点ID'); + $table->unsignedInteger('online_user')->comment('在线用户数'); + $table->unsignedInteger('log_time')->comment('记录时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('ss_node_online_log'); + } +} diff --git a/database/migrations/2020_07_18_032504_create_node_table.php b/database/migrations/2020_08_21_145711_create_ss_node_table.php similarity index 71% rename from database/migrations/2020_07_18_032504_create_node_table.php rename to database/migrations/2020_08_21_145711_create_ss_node_table.php index 08cac50d..4781e17a 100644 --- a/database/migrations/2020_07_18_032504_create_node_table.php +++ b/database/migrations/2020_08_21_145711_create_ss_node_table.php @@ -4,38 +4,39 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class CreateNodeTable extends Migration { +class CreateSsNodeTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { - Schema::create('node', function(Blueprint $table) { - $table->bigIncrements('id'); - $table->unsignedTinyInteger('type')->default(1)->comment('服务类型:1-Shadowsocks(R)、2-V2ray、3-Trojan、4-VNet'); + Schema::create('ss_node', function(Blueprint $table) { + $table->increments('id'); + $table->boolean('type')->default(1)->comment('服务类型:1-Shadowsocks(R)、2-V2ray、3-Trojan、4-VNet'); $table->string('name', 128)->comment('名称'); $table->char('country_code', 5)->default('un')->comment('国家代码'); $table->string('server')->nullable()->comment('服务器域名地址'); - $table->char('ip', 15)->nullable()->comment('服务器IPV4地址'); + $table->ipAddress('ip')->nullable()->comment('服务器IPV4地址'); $table->ipAddress('ipv6')->nullable()->comment('服务器IPV6地址'); - $table->string('relay_server')->nullable()->comment('中转地址'); - $table->unsignedSmallInteger('relay_port')->nullable()->default(0)->comment('中转端口'); $table->unsignedTinyInteger('level')->default(0)->comment('等级:0-无等级,全部可见'); $table->unsignedBigInteger('speed_limit')->default(0)->comment('节点限速,为0表示不限速,单位Byte'); $table->unsignedSmallInteger('client_limit')->default(0)->comment('设备数限制'); + $table->string('relay_server')->nullable()->comment('中转地址'); + $table->unsignedSmallInteger('relay_port')->nullable()->comment('中转端口'); $table->string('description')->nullable()->comment('节点简单描述'); + $table->string('geo')->nullable()->comment('节点地理位置'); $table->string('method', 32)->default('aes-256-cfb')->comment('加密方式'); $table->string('protocol', 64)->default('origin')->comment('协议'); $table->string('protocol_param', 128)->nullable()->comment('协议参数'); $table->string('obfs', 64)->default('plain')->comment('混淆'); $table->string('obfs_param')->nullable()->comment('混淆参数'); - $table->unsignedDecimal('traffic_rate', 6)->default(1.00)->comment('流量比率'); - $table->boolean('is_subscribe')->default(1)->comment('是否允许用户订阅该节点:0-否、1-是'); + $table->float('traffic_rate', 6)->unsigned()->default(1.00)->comment('流量比率'); + $table->boolean('is_subscribe')->default(1)->index()->comment('是否允许用户订阅该节点:0-否、1-是'); $table->boolean('is_ddns')->default(0)->comment('是否使用DDNS:0-否、1-是'); $table->boolean('is_relay')->default(0)->comment('是否中转节点:0-否、1-是'); $table->boolean('is_udp')->default(1)->comment('是否启用UDP:0-不启用、1-启用'); - $table->unsignedSmallInteger('push_port')->default(0)->comment('消息推送端口'); + $table->unsignedSmallInteger('push_port')->default(1000)->comment('消息推送端口'); $table->boolean('detection_type')->default(1)->comment('节点检测: 0-关闭、1-只检测TCP、2-只检测ICMP、3-检测全部'); $table->boolean('compatible')->default(0)->comment('兼容SS'); $table->boolean('single')->default(0)->comment('启用单端口功能:0-否、1-是'); @@ -48,18 +49,13 @@ class CreateNodeTable extends Migration { $table->string('v2_method', 32)->default('aes-128-gcm')->comment('V2Ray加密方式'); $table->string('v2_net', 16)->default('tcp')->comment('V2Ray传输协议'); $table->string('v2_type', 32)->default('none')->comment('V2Ray伪装类型'); - $table->string('v2_host')->comment('V2Ray伪装的域名'); - $table->string('v2_path')->comment('V2Ray的WS/H2路径'); - $table->boolean('v2_tls')->default(0)->comment('V2Ray后端TLS:0-未开启、1-开启'); + $table->string('v2_host')->nullable()->comment('V2Ray伪装的域名'); + $table->string('v2_path')->nullable()->comment('V2Ray的WS/H2路径'); + $table->boolean('v2_tls')->default(0)->comment('V2Ray连接TLS:0-未开启、1-开启'); $table->text('tls_provider')->nullable()->comment('V2Ray节点的TLS提供商授权信息'); - $table->timestamps(); - $table->index('is_subscribe', 'idx_sub'); - $table->engine = 'InnoDB'; - $table->charset = 'utf8mb4'; - $table->collation = 'utf8mb4_unicode_ci'; + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); }); - - DB::statement("ALTER TABLE `node` comment '节点信息表'"); } /** @@ -68,6 +64,6 @@ class CreateNodeTable extends Migration { * @return void */ public function down() { - Schema::dropIfExists('node'); + Schema::dropIfExists('ss_node'); } } diff --git a/database/migrations/2020_08_21_145711_create_ticket_reply_table.php b/database/migrations/2020_08_21_145711_create_ticket_reply_table.php new file mode 100644 index 00000000..804fbc75 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_ticket_reply_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->unsignedInteger('ticket_id')->comment('工单ID'); + $table->unsignedInteger('user_id')->default(0)->comment('回复用户ID'); + $table->unsignedInteger('admin_id')->default(0)->comment('管理员ID'); + $table->text('content')->comment('回复内容'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('ticket_reply'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_ticket_table.php b/database/migrations/2020_08_21_145711_create_ticket_table.php new file mode 100644 index 00000000..5bf69e20 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_ticket_table.php @@ -0,0 +1,34 @@ +increments('id'); + $table->unsignedInteger('user_id')->default(0)->comment('用户ID'); + $table->unsignedInteger('admin_id')->default(0)->comment('管理员ID'); + $table->string('title')->comment('标题'); + $table->text('content')->comment('内容'); + $table->boolean('status')->default(0)->comment('状态:0-待处理、1-已处理未关闭、2-已关闭'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('ticket'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_baned_log_table.php b/database/migrations/2020_08_21_145711_create_user_baned_log_table.php new file mode 100644 index 00000000..0cae763d --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_baned_log_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->unsignedInteger('user_id')->comment('用户ID'); + $table->unsignedInteger('time')->default(0)->comment('封禁账号时长,单位分钟'); + $table->string('description')->nullable()->comment('操作描述'); + $table->boolean('status')->default(0)->comment('状态:0-未处理、1-已处理'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_baned_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_credit_log_table.php b/database/migrations/2020_08_21_145711_create_user_credit_log_table.php new file mode 100644 index 00000000..4a2ccde2 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_credit_log_table.php @@ -0,0 +1,34 @@ +increments('id'); + $table->unsignedInteger('user_id')->default(0)->comment('账号ID'); + $table->unsignedInteger('order_id')->default(0)->comment('订单ID'); + $table->unsignedInteger('before')->default(0)->comment('发生前余额,单位分'); + $table->unsignedInteger('after')->default(0)->comment('发生后金额,单位分'); + $table->integer('amount')->default(0)->comment('发生金额,单位分'); + $table->string('description')->nullable()->comment('操作描述'); + $table->dateTime('created_at')->comment('创建时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_credit_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_daily_data_flow_table.php b/database/migrations/2020_08_21_145711_create_user_daily_data_flow_table.php new file mode 100644 index 00000000..86699416 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_daily_data_flow_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->unsignedInteger('user_id')->default(0)->comment('用户ID'); + $table->unsignedInteger('node_id')->default(0)->comment('节点ID,0表示统计全部节点'); + $table->unsignedBigInteger('u')->default(0)->comment('上传流量'); + $table->unsignedBigInteger('d')->default(0)->comment('下载流量'); + $table->unsignedBigInteger('total')->default(0)->comment('总流量'); + $table->string('traffic')->nullable()->comment('总流量(带单位)'); + $table->dateTime('created_at')->comment('创建时间'); + $table->index(['user_id', 'node_id'], 'idx_user_node'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_daily_data_flow'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_data_modify_log_table.php b/database/migrations/2020_08_21_145711_create_user_data_modify_log_table.php new file mode 100644 index 00000000..8b566af5 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_data_modify_log_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->unsignedInteger('user_id')->default(0)->comment('用户ID'); + $table->unsignedInteger('order_id')->default(0)->comment('发生的订单ID'); + $table->bigInteger('before')->default(0)->comment('操作前流量'); + $table->bigInteger('after')->default(0)->comment('操作后流量'); + $table->string('description')->nullable()->comment('描述'); + $table->dateTime('created_at')->comment('创建时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_data_modify_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_group_table.php b/database/migrations/2020_08_21_145711_create_user_group_table.php new file mode 100644 index 00000000..b7528c6d --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_group_table.php @@ -0,0 +1,29 @@ +increments('id'); + $table->string('name')->comment('分组名称'); + $table->json('nodes')->nullable()->comment('关联的节点ID,多个用,号分隔'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_group'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_hourly_data_flow_table.php b/database/migrations/2020_08_21_145711_create_user_hourly_data_flow_table.php new file mode 100644 index 00000000..cc8b99ba --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_hourly_data_flow_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->unsignedInteger('user_id')->comment('用户ID'); + $table->unsignedInteger('node_id')->default(0)->comment('节点ID,0表示统计全部节点'); + $table->unsignedBigInteger('u')->default(0)->comment('上传流量'); + $table->unsignedBigInteger('d')->default(0)->comment('下载流量'); + $table->unsignedBigInteger('total')->default(0)->comment('总流量'); + $table->string('traffic')->nullable()->comment('总流量(带单位)'); + $table->dateTime('created_at')->comment('创建时间'); + $table->index(['user_id', 'node_id'], 'idx_user_node'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_hourly_data_flow'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_login_log_table.php b/database/migrations/2020_08_21_145711_create_user_login_log_table.php new file mode 100644 index 00000000..a0bf6e9d --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_login_log_table.php @@ -0,0 +1,36 @@ +increments('id'); + $table->unsignedInteger('user_id')->default(0)->comment('用户ID'); + $table->ipAddress('ip')->comment('IP地址'); + $table->string('country', 128)->comment('国家'); + $table->string('province', 128)->comment('省份'); + $table->string('city', 128)->comment('城市'); + $table->string('county', 128)->comment('郡县'); + $table->string('isp', 128)->comment('运营商'); + $table->string('area')->comment('地区'); + $table->dateTime('created_at')->comment('创建时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_login_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_subscribe_log_table.php b/database/migrations/2020_08_21_145711_create_user_subscribe_log_table.php new file mode 100644 index 00000000..85d2914a --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_subscribe_log_table.php @@ -0,0 +1,31 @@ +increments('id'); + $table->unsignedInteger('user_subscribe_id')->index()->comment('对应user_subscribe的id'); + $table->ipAddress('request_ip')->nullable()->comment('请求IP'); + $table->dateTime('request_time')->comment('请求时间'); + $table->text('request_header')->nullable()->comment('请求头部信息'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_subscribe_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_subscribe_table.php b/database/migrations/2020_08_21_145711_create_user_subscribe_table.php new file mode 100644 index 00000000..3fc9f808 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_subscribe_table.php @@ -0,0 +1,36 @@ +increments('id'); + $table->unsignedInteger('user_id')->default(0)->comment('用户ID'); + $table->char('code', 8)->index()->comment('订阅地址唯一识别码'); + $table->unsignedInteger('times')->default(0)->comment('地址请求次数'); + $table->boolean('status')->default(1)->comment('状态:0-禁用、1-启用'); + $table->unsignedInteger('ban_time')->nullable()->comment('封禁时间'); + $table->string('ban_desc', 50)->nullable()->comment('封禁理由'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + $table->index(['user_id', 'status'], 'user_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_subscribe'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_table.php b/database/migrations/2020_08_21_145711_create_user_table.php new file mode 100644 index 00000000..943e787f --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_table.php @@ -0,0 +1,63 @@ +increments('id'); + $table->string('username', 64)->comment('昵称'); + $table->string('email', 128)->unique()->comment('邮箱'); + $table->string('password', 64)->comment('密码'); + $table->unsignedSmallInteger('port')->default(0)->comment('代理端口'); + $table->string('passwd', 16)->comment('代理密码'); + $table->uuid('vmess_id'); + $table->unsignedBigInteger('transfer_enable')->default(1099511627776)->comment('可用流量,单位字节,默认1TiB'); + $table->unsignedBigInteger('u')->default(0)->comment('已上传流量,单位字节'); + $table->unsignedBigInteger('d')->default(0)->comment('已下载流量,单位字节'); + $table->unsignedInteger('t')->nullable()->comment('最后使用时间'); + $table->ipAddress('ip')->nullable()->comment('最后连接IP'); + $table->boolean('enable')->default(1)->comment('代理状态'); + $table->string('method', 30)->default('aes-256-cfb')->comment('加密方式'); + $table->string('protocol', 30)->default('origin')->comment('协议'); + $table->string('protocol_param')->nullable()->comment('协议参数'); + $table->string('obfs', 30)->default('plain')->comment('混淆'); + $table->unsignedBigInteger('speed_limit')->default(0)->comment('用户限速,为0表示不限速,单位Byte'); + $table->string('wechat', 30)->nullable()->comment('微信'); + $table->string('qq', 20)->nullable()->comment('QQ'); + $table->unsignedInteger('credit')->default(0)->comment('余额,单位分'); + $table->date('expired_at')->default('2099-01-01')->comment('过期时间'); + $table->unsignedInteger('ban_time')->nullable()->comment('封禁到期时间'); + $table->text('remark')->nullable()->comment('备注'); + $table->unsignedTinyInteger('level')->default(0)->comment('等级,默认0级'); + $table->unsignedInteger('group_id')->default(0)->comment('所属分组'); + $table->boolean('is_admin')->default(0)->comment('是否管理员:0-否、1-是'); + $table->ipAddress('reg_ip')->default('127.0.0.1')->comment('注册IP'); + $table->unsignedInteger('last_login')->default(0)->comment('最后登录时间'); + $table->unsignedInteger('inviter_id')->nullable()->comment('邀请人'); + $table->date('reset_time')->nullable()->comment('流量重置日期'); + $table->unsignedInteger('invite_num')->default(0)->comment('可生成邀请码数'); + $table->boolean('status')->default(0)->comment('状态:-1-禁用、0-未激活、1-正常'); + $table->string('remember_token')->nullable(); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + $table->index(['enable', 'status', 'port'], 'idx_search'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_user_traffic_log_table.php b/database/migrations/2020_08_21_145711_create_user_traffic_log_table.php new file mode 100644 index 00000000..38252932 --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_user_traffic_log_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->unsignedInteger('user_id')->default(0)->comment('用户ID'); + $table->unsignedInteger('node_id')->default(0)->comment('节点ID'); + $table->unsignedInteger('u')->default(0)->comment('上传流量'); + $table->unsignedInteger('d')->default(0)->comment('下载流量'); + $table->float('rate', 6)->unsigned()->comment('倍率'); + $table->string('traffic', 32)->comment('产生流量'); + $table->unsignedInteger('log_time')->comment('记录时间'); + $table->index(['user_id', 'node_id', 'log_time'], 'idx_user_node_time'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('user_traffic_log'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_verify_code_table.php b/database/migrations/2020_08_21_145711_create_verify_code_table.php new file mode 100644 index 00000000..6ddca0cc --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_verify_code_table.php @@ -0,0 +1,32 @@ +increments('id'); + $table->string('address', 128)->comment('用户邮箱'); + $table->char('code', 6)->comment('验证码'); + $table->boolean('status')->default(0)->comment('状态:0-未使用、1-已使用、2-已失效'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('verify_code'); + } +} diff --git a/database/migrations/2020_08_21_145711_create_verify_table.php b/database/migrations/2020_08_21_145711_create_verify_table.php new file mode 100644 index 00000000..3d9bf61b --- /dev/null +++ b/database/migrations/2020_08_21_145711_create_verify_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->boolean('type')->default(1)->comment('激活类型:1-自行激活、2-管理员激活'); + $table->unsignedInteger('user_id')->comment('用户ID'); + $table->string('token', 32)->comment('校验token'); + $table->boolean('status')->default(0)->comment('状态:0-未使用、1-已使用、2-已失效'); + $table->dateTime('created_at')->comment('创建时间'); + $table->dateTime('updated_at')->comment('最后更新时间'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + Schema::dropIfExists('verify'); + } +} diff --git a/database/migrations/2020_08_21_150711_preset_data.php b/database/migrations/2020_08_21_150711_preset_data.php new file mode 100644 index 00000000..011e5e45 --- /dev/null +++ b/database/migrations/2020_08_21_150711_preset_data.php @@ -0,0 +1,528 @@ + '管理员', + 'email' => 'test@test.com', + 'password' => Hash::make('123456'), + 'port' => 10000, + 'passwd' => Str::random(), + 'vmess_id' => Str::uuid(), + 'is_admin' => 1 + ]); + + // 生成最初的等级 + Level::insert(['level' => 0, 'name' => 'Free']); + for($i = 1; $i < 8; $i++){ + Level::insert(['level' => $i, 'name' => 'VIP-'.$i]); + } + + // ss系列 加密方式 + SsConfig::insert(['name' => 'none', 'type' => 1, 'is_default' => 1]); + SsConfig::insert(['name' => 'rc4-md5']); + SsConfig::insert(['name' => 'aes-128-cfb']); + SsConfig::insert(['name' => 'aes-192-cfb']); + SsConfig::insert(['name' => 'aes-256-cfb']); + SsConfig::insert(['name' => 'aes-128-ctr']); + SsConfig::insert(['name' => 'aes-192-ctr']); + SsConfig::insert(['name' => 'aes-256-ctr']); + SsConfig::insert(['name' => 'aes-128-gcm']); + SsConfig::insert(['name' => 'aes-192-gcm']); + SsConfig::insert(['name' => 'aes-256-gcm']); + SsConfig::insert(['name' => 'bf-cfb']); + SsConfig::insert(['name' => 'cast5-cfb']); + SsConfig::insert(['name' => 'des-cfb']); + SsConfig::insert(['name' => 'salsa20']); + SsConfig::insert(['name' => 'chacha20']); + SsConfig::insert(['name' => 'chacha20-ietf']); + SsConfig::insert(['name' => 'chacha20-ietf-poly1305']); + + // ss系列 协议 + SsConfig::insert(['name' => 'origin', 'type' => 2, 'is_default' => 1]); + SsConfig::insert(['name' => 'auth_sha1_v4', 'type' => 2]); + SsConfig::insert(['name' => 'auth_aes128_md5', 'type' => 2]); + SsConfig::insert(['name' => 'auth_aes128_sha1', 'type' => 2]); + SsConfig::insert(['name' => 'auth_chain_a', 'type' => 2]); + SsConfig::insert(['name' => 'auth_chain_b', 'type' => 2]); + SsConfig::insert(['name' => 'auth_chain_c', 'type' => 2]); + SsConfig::insert(['name' => 'auth_chain_d', 'type' => 2]); + SsConfig::insert(['name' => 'auth_chain_e', 'type' => 2]); + SsConfig::insert(['name' => 'auth_chain_f', 'type' => 2]); + + // ss系列 混淆 + SsConfig::insert(['name' => 'plain', 'type' => 3, 'is_default' => 1]); + SsConfig::insert(['name' => 'http_simple', 'type' => 3]); + SsConfig::insert(['name' => 'http_post', 'type' => 3]); + SsConfig::insert(['name' => 'tls1.2_ticket_auth', 'type' => 3]); + SsConfig::insert(['name' => 'tls1.2_ticket_fastauth', 'type' => 3]); + + $configList = [ + 'is_rand_port', + 'is_user_rand_port', + 'invite_num', + 'is_register', + 'is_invite_register', + 'website_name', + 'is_reset_password', + 'reset_password_times', + 'website_url', + 'referral_type', + 'active_times', + 'is_checkin', + 'min_rand_traffic', + 'max_rand_traffic', + 'wechat_qrcode', + 'alipay_qrcode', + 'traffic_limit_time', + 'referral_traffic', + 'referral_percent', + 'referral_money', + 'referral_status', + 'default_traffic', + 'traffic_warning', + 'traffic_warning_percent', + 'expire_warning', + 'expire_days', + 'reset_traffic', + 'default_days', + 'subscribe_max', + 'min_port', + 'max_port', + 'is_captcha', + 'is_traffic_ban', + 'traffic_ban_value', + 'traffic_ban_time', + 'is_clear_log', + 'is_node_offline', + 'webmaster_email', + 'is_notification', + 'server_chan_key', + 'is_subscribe_ban', + 'subscribe_ban_times', + 'codepay_url', + 'codepay_id', + 'codepay_key', + 'is_free_code', + 'is_forbid_robot', + 'subscribe_domain', + 'auto_release_port', + 'website_callback_url', + 'web_api_url', + 'v2ray_license', + 'trojan_license', + 'v2ray_tls_provider', + 'website_analytics', + 'website_customer_service', + 'register_ip_limit', + 'is_email_filtering', + 'is_push_bear', + 'push_bear_send_key', + 'push_bear_qrcode', + 'is_ban_status', + 'is_namesilo', + 'namesilo_key', + 'website_logo', + 'website_home_logo', + 'nodes_detection', + 'detection_check_times', + 'is_forbid_china', + 'is_forbid_oversea', + 'AppStore_id', + 'AppStore_password', + 'is_activate_account', + 'node_daily_report', + 'mix_subscribe', + 'rand_subscribe', + 'is_custom_subscribe', + 'is_AliPay', + 'is_QQPay', + 'is_WeChatPay', + 'is_otherPay', + 'alipay_private_key', + 'alipay_public_key', + 'alipay_transport', + 'alipay_currency', + 'bitpay_secret', + 'f2fpay_app_id', + 'f2fpay_private_key', + 'f2fpay_public_key', + 'website_security_code', + 'subject_name', + 'geetest_id', + 'geetest_key', + 'google_captcha_sitekey', + 'google_captcha_secret', + 'user_invite_days', + 'admin_invite_days', + 'offline_check_times', + 'payjs_mch_id', + 'payjs_key', + 'maintenance_mode', + 'maintenance_time', + 'maintenance_content', + 'bark_key', + 'hcaptcha_secret', + 'hcaptcha_sitekey', + 'paypal_username', + 'paypal_password', + 'paypal_secret', + 'paypal_certificate', + 'paypal_app_id', + 'redirect_url', + 'epay_url', + 'epay_mch_id', + 'epay_key' + ]; + + foreach($configList as $config){ + Config::insert(['name' => $config]); + } + + Config::whereName('invite_num')->update(['value' => 3]); + Config::whereName('is_register')->update(['value' => 1]); + Config::whereName('is_invite_register')->update(['value' => 2]); + Config::whereName('website_name')->update(['value' => 'ProxyPanel']); + Config::whereName('is_reset_password')->update(['value' => 1]); + Config::whereName('reset_password_times')->update(['value' => 3]); + Config::whereName('website_url')->update(['value' => 'https://demo.proxypanel.ml']); + Config::whereName('active_times')->update(['value' => 3]); + Config::whereName('is_checkin')->update(['value' => 1]); + Config::whereName('min_rand_traffic')->update(['value' => 10]); + Config::whereName('max_rand_traffic')->update(['value' => 500]); + Config::whereName('traffic_limit_time')->update(['value' => 1440]); + Config::whereName('referral_traffic')->update(['value' => 1024]); + Config::whereName('referral_percent')->update(['value' => 0.2]); + Config::whereName('referral_money')->update(['value' => 100]); + Config::whereName('referral_status')->update(['value' => 1]); + Config::whereName('default_traffic')->update(['value' => 1024]); + Config::whereName('traffic_warning_percent')->update(['value' => 80]); + Config::whereName('expire_days')->update(['value' => 15]); + Config::whereName('reset_traffic')->update(['value' => 1]); + Config::whereName('default_days')->update(['value' => 7]); + Config::whereName('subscribe_max')->update(['value' => 3]); + Config::whereName('min_port')->update(['value' => 10000]); + Config::whereName('max_port')->update(['value' => 65535]); + Config::whereName('is_traffic_ban')->update(['value' => 1]); + Config::whereName('traffic_ban_value')->update(['value' => 10]); + Config::whereName('traffic_ban_time')->update(['value' => 60]); + Config::whereName('is_clear_log')->update(['value' => 1]); + Config::whereName('is_subscribe_ban')->update(['value' => 1]); + Config::whereName('subscribe_ban_times')->update(['value' => 20]); + Config::whereName('auto_release_port')->update(['value' => 1]); + Config::whereName('register_ip_limit')->update(['value' => 5]); + Config::whereName('detection_check_times')->update(['value' => 3]); + Config::whereName('alipay_transport')->update(['value' => 'http']); + Config::whereName('alipay_currency')->update(['value' => 'USD']); + Config::whereName('user_invite_days')->update(['value' => 7]); + Config::whereName('admin_invite_days')->update(['value' => 7]); + + // 节点用标签 + $labelList = [ + 'Netflix', + 'Hulu', + 'HBO', + 'Amazon Video', + 'DisneyNow', + 'BBC', + 'Channel 4', + 'Fox+', + 'Happyon', + 'AbemeTV', + 'DMM', + 'NicoNico', + 'Pixiv', + 'TVer', + 'TVB', + 'HBO Go', + 'BiliBili港澳台', + '動畫瘋', + '四季線上影視', + 'LINE TV', + 'Youtube Premium', + '中国视频网站', + '网易云音乐', + 'QQ音乐', + 'DisneyPlus', + 'Pandora', + 'SoundCloud', + 'Spotify', + 'TIDAL', + 'TikTok', + 'Pornhub', + 'Twitch' + ]; + + foreach($labelList as $label){ + Label::insert(['name' => $label]); + } + + // 黑名单邮箱 过滤列表 + $blackEmailSuffixList = [ + 'chacuo.com', + '1766258.com', + '3202.com', + '4057.com', + '4059.com', + 'a7996.com', + 'bccto.me', + 'bnuis.com', + 'chaichuang.com', + 'cr219.com', + 'cuirushi.org', + 'dawin.com', + 'jiaxin8736.com', + 'lakqs.com', + 'urltc.com', + '027168.com', + '10minutemail.net', + '11163.com', + '1shivom.com', + 'auoie.com', + 'bareed.ws', + 'bit-degree.com', + 'cjpeg.com', + 'cool.fr.nf', + 'courriel.fr.nf', + 'disbox.net', + 'disbox.org', + 'fidelium10.com', + 'get365.pw', + 'ggr.la', + 'grr.la', + 'guerrillamail.biz', + 'guerrillamail.com', + 'guerrillamail.de', + 'guerrillamail.net', + 'guerrillamail.org', + 'guerrillamailblock.com', + 'hubii-network.com', + 'hurify1.com', + 'itoup.com', + 'jetable.fr.nf', + 'jnpayy.com', + 'juyouxi.com', + 'mail.bccto.me', + 'www.bccto.me', + 'mega.zik.dj', + 'moakt.co', + 'moakt.ws', + 'molms.com', + 'moncourrier.fr.nf', + 'monemail.fr.nf', + 'monmail.fr.nf', + 'nomail.xl.cx', + 'nospam.ze.tc', + 'pay-mon.com', + 'poly-swarm.com', + 'sgmh.online', + 'sharklasers.com', + 'shiftrpg.com', + 'spam4.me', + 'speed.1s.fr', + 'tmail.ws', + 'tmails.net', + 'tmpmail.net', + 'tmpmail.org', + 'travala10.com', + 'yopmail.com', + 'yopmail.fr', + 'yopmail.net', + 'yuoia.com', + 'zep-hyr.com', + 'zippiex.com', + 'lrc8.com', + '1otc.com', + 'emailna.co', + 'mailinator.com', + 'nbzmr.com', + 'awsoo.com', + 'zhcne.com', + '0box.eu', + 'contbay.com', + 'damnthespam.com', + 'kurzepost.de', + 'objectmail.com', + 'proxymail.eu', + 'rcpt.at', + 'trash-mail.at', + 'trashmail.at', + 'trashmail.com', + 'trashmail.io', + 'trashmail.me', + 'trashmail.net', + 'wegwerfmail.de', + 'wegwerfmail.net', + 'wegwerfmail.org', + 'nwytg.net', + 'despam.it', + 'spambox.us', + 'spam.la', + 'mytrashmail.com', + 'mt2014.com', + 'mt2015.com', + 'thankyou2010.com', + 'trash2009.com', + 'mt2009.com', + 'trashymail.com', + 'tempemail.net', + 'slopsbox.com', + 'mailnesia.com', + 'ezehe.com', + 'tempail.com', + 'newairmail.com', + 'temp-mail.org', + 'linshiyouxiang.net', + 'zwoho.com', + 'mailboxy.fun', + 'crypto-net.club', + 'guerrillamail.info', + 'pokemail.net', + 'odmail.cn', + 'hlooy.com', + 'ozlaq.com', + '666email.com', + 'linshiyou.com', + 'linshiyou.pl', + 'woyao.pl', + 'yaowo.pl' + ]; + + foreach($blackEmailSuffixList as $emailSuffix){ + EmailFilter::insert(['type' => 1, 'words' => $emailSuffix]); + } + + // 白名单邮箱 过滤列表 + $whiteEmailSuffixList = [ + 'qq.com', + '163.com', + '126.com', + '189.com', + 'sohu.com', + 'gmail.com', + 'outlook.com', + 'icloud.com' + ]; + + foreach($whiteEmailSuffixList as $emailSuffix){ + EmailFilter::insert(['type' => 2, 'words' => $emailSuffix]); + } + + $countryList = [ + 'au' => '澳大利亚', + 'br' => '巴西', + 'ca' => '加拿大', + 'ch' => '瑞士', + 'cn' => '中国', + 'de' => '德国', + 'dk' => '丹麦', + 'eg' => '埃及', + 'fr' => '法国', + 'gr' => '希腊', + 'hk' => '香港', + 'id' => '印度尼西亚', + 'ie' => '爱尔兰', + 'il' => '以色列', + 'in' => '印度', + 'iq' => '伊拉克', + 'ir' => '伊朗', + 'it' => '意大利', + 'jp' => '日本', + 'kr' => '韩国', + 'mx' => '墨西哥', + 'my' => '马来西亚', + 'nl' => '荷兰', + 'no' => '挪威', + 'nz' => '纽西兰', + 'ph' => '菲律宾', + 'ru' => '俄罗斯', + 'se' => '瑞典', + 'sg' => '新加坡', + 'th' => '泰国', + 'tr' => '土耳其', + 'tw' => '台湾', + 'uk' => '英国', + 'us' => '美国', + 'vn' => '越南', + 'pl' => '波兰', + 'kz' => '哈萨克斯坦', + 'ua' => '乌克兰', + 'ro' => '罗马尼亚', + 'ae' => '阿联酋', + 'za' => '南非', + 'mm' => '缅甸', + 'is' => '冰岛', + 'fi' => '芬兰', + 'lu' => '卢森堡', + 'be' => '比利时', + 'bg' => '保加利亚', + 'lt' => '立陶宛', + 'co' => '哥伦比亚', + 'mo' => '澳门', + 'ke' => '肯尼亚', + 'cz' => '捷克', + 'md' => '摩尔多瓦', + 'es' => '西班牙', + 'pk' => '巴基斯坦', + 'pt' => '葡萄牙', + 'hu' => '匈牙利', + 'ar' => '阿根廷' + ]; + + foreach($countryList as $code => $name){ + Country::insert(['code' => $code, 'name' => $name]); + } + + // 审核规则 + $ruleList = [ + '360' => '(.*.||)(^360|0360|1360|3600|360safe|^so|qhimg|qhmsg|^yunpan|qihoo|qhcdn|qhupdate|360totalsecurity|360shouji|qihucdn|360kan|secmp).(cn|com|net)', + '腾讯管家' => '(.guanjia.qq.com|qqpcmgr|QQPCMGR)', + '金山毒霸' => '(.*.||)(rising|kingsoft|duba|xindubawukong|jinshanduba).(com|net|org)', + '暗网相关' => '(.*.||)(netvigator|torproject).(cn|com|net|org)', + '百度定位' => '(api|ps|sv|offnavi|newvector|ulog.imap|newloc|tracknavi)(.map|).(baidu|n.shifen).com', + '法轮功类' => '(.*.||)(dafahao|minghui|dongtaiwang|dajiyuan|falundata|shenyun|tuidang|epochweekly|epochtimes|ntdtv|falundafa|wujieliulan|zhengjian).(org|com|net)', + 'BT扩展名' => '(torrent|.torrent|peer_id=|info_hash|get_peers|find_node|BitTorrent|announce_peer|announce.php?passkey=)', + '邮件滥发' => '((^.*@)(guerrillamail|guerrillamailblock|sharklasers|grr|pokemail|spam4|bccto|chacuo|027168).(info|biz|com|de|net|org|me|la)|Subject|HELO|SMTP)', + '迅雷下载' => '(.?)(xunlei|sandai|Thunder|XLLiveUD)(.)', + '大陆应用' => '(.*.||)(baidu|qq|163|189|10000|10010|10086|sohu|sogoucdn|sogou|uc|58|taobao|qpic|bilibili|hdslb|acgvideo|sina|douban|doubanio|xiaohongshu|sinaimg|weibo|xiaomi|youzanyun|meituan|dianping|biliapi|huawei|pinduoduo|cnzz).(org|com|net|cn)', + '大陆银行' => '(.*.||)(icbc|ccb|boc|bankcomm|abchina|cmbchina|psbc|cebbank|cmbc|pingan|spdb|citicbank|cib|hxb|bankofbeijing|hsbank|tccb|4001961200|bosc|hkbchina|njcb|nbcb|lj-bank|bjrcb|jsbchina|gzcb|cqcbank|czbank|hzbank|srcb|cbhb|cqrcb|grcbank|qdccb|bocd|hrbcb|jlbank|bankofdl|qlbchina|dongguanbank|cscb|hebbank|drcbank|zzbank|bsb|xmccb|hljrcc|jxnxs|gsrcu|fjnx|sxnxs|gx966888|gx966888|zj96596|hnnxs|ahrcu|shanxinj|hainanbank|scrcu|gdrcu|hbxh|ynrcc|lnrcc|nmgnxs|hebnx|jlnls|js96008|hnnx|sdnxs).(org|com|net|cn)', + '台湾银行' => '(.*.||)(firstbank|bot|cotabank|megabank|tcb-bank|landbank|hncb|bankchb|tbb|ktb|tcbbank|scsb|bop|sunnybank|kgibank|fubon|ctbcbank|cathaybk|eximbank|bok|ubot|feib|yuantabank|sinopac|esunbank|taishinbank|jihsunbank|entiebank|hwataibank|csc|skbank).(org|com|net|tw)', + '大陆第三方支付' => '(.*.||)(alipay|baifubao|yeepay|99bill|95516|51credit|cmpay|tenpay|lakala|jdpay).(org|com|net|cn)', + '台湾特供' => '(.*.||)(visa|mycard|mastercard|gov|gash|beanfun|bank|line).(org|com|net|cn|tw|jp|kr)', + '涉政治类' => '(.*.||)(shenzhoufilm|secretchina|renminbao|aboluowang|mhradio|guangming|zhengwunet|soundofhope|yuanming|zhuichaguoji|fgmtv|xinsheng|shenyunperformingarts|epochweekly|tuidang|shenyun|falundata|bannedbook|pincong|rfi|mingjingnews|boxun|rfa|scmp|ogate|voachinese).(org|com|net|rocks|fr)', + '流媒体' => '(.*.||)(youtube|googlevideo|hulu|netflix|nflxvideo|akamai|nflximg|hbo|mtv|bbc|tvb).(org|club|com|net|tv)', + '测速类' => '(.*.||)(fast|speedtest).(org|com|net|cn)', + '外汇交易类' => '(.*.||)(metatrader4|metatrader5|mql5).(org|com|net)' + ]; + + foreach($ruleList as $name => $pattern){ + Rule::insert(['type' => 1, 'name' => $name, 'pattern' => $pattern]); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() { + echo 'plz run php artisan migrate:fresh'.PHP_EOL; + echo '请运行 php artisan migrate:fresh'.PHP_EOL; + } +} diff --git a/resources/views/admin/subscribe/subscribeList.blade.php b/resources/views/admin/subscribe/subscribeList.blade.php index ad14c6ed..56df333b 100644 --- a/resources/views/admin/subscribe/subscribeList.blade.php +++ b/resources/views/admin/subscribe/subscribeList.blade.php @@ -61,7 +61,7 @@ target="_blank">{{$subscribe->times}} {{$subscribe->updated_at}} - {{$subscribe->ban_time > 0 ? date('Y-m-d H:i', $subscribe->ban_time): ''}} + {{$subscribe->ban_time ? date('Y-m-d H:i', $subscribe->ban_time): ''}} {{$subscribe->ban_desc}} @if($subscribe->status == 0) diff --git a/sql/db.sql b/sql/db.sql index 62e88033..529562e2 100644 --- a/sql/db.sql +++ b/sql/db.sql @@ -1,496 +1,475 @@ -# ************************************************************ -# Sequel Pro SQL dump -# Version 4541 -# -# http://www.sequelpro.com/ -# https://github.com/sequelpro/sequelpro -# -# Host: 127.0.0.1 (MySQL 5.7.18) -# Database: 2 -# Generation Time: 2017-07-29 06:28:10 +0000 -# ************************************************************ +-- Adminer 4.7.7 MySQL dump +SET NAMES utf8; +SET time_zone = '+00:00'; +SET foreign_key_checks = 0; +SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; -/*!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 utf8 */; -/*!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 */; +SET NAMES utf8mb4; - --- ---------------------------- --- Table structure for ss_node --- ---------------------------- -CREATE TABLE `ss_node` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '服务类型:1-Shadowsocks(R)、2-V2ray、3-Trojan、4-VNet', - `name` VARCHAR(128) NOT NULL COMMENT '名称', - `country_code` CHAR(5) NOT NULL DEFAULT 'un' COMMENT '国家代码', - `server` VARCHAR(255) DEFAULT NULL COMMENT '服务器域名地址', - `ip` CHAR(15) DEFAULT NULL COMMENT '服务器IPV4地址', - `ipv6` VARCHAR(45) DEFAULT NULL COMMENT '服务器IPV6地址', - `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '等级:0-无等级,全部可见', - `speed_limit` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点限速,为0表示不限速,单位Byte', - `client_limit` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '设备数限制', - `relay_server` VARCHAR(255) DEFAULT NULL COMMENT '中转地址', - `relay_port` SMALLINT(5) UNSIGNED DEFAULT 0 COMMENT '中转端口', - `description` VARCHAR(255) DEFAULT NULL COMMENT '节点简单描述', - `geo` VARCHAR(255) DEFAULT NULL COMMENT '节点地理位置', - `method` VARCHAR(32) NOT NULL DEFAULT 'aes-256-cfb' COMMENT '加密方式', - `protocol` VARCHAR(64) NOT NULL DEFAULT 'origin' COMMENT '协议', - `protocol_param` VARCHAR(128) DEFAULT NULL COMMENT '协议参数', - `obfs` VARCHAR(64) NOT NULL DEFAULT 'plain' COMMENT '混淆', - `obfs_param` VARCHAR(255) DEFAULT NULL COMMENT '混淆参数', - `traffic_rate` FLOAT(6, 2) UNSIGNED NOT NULL DEFAULT '1.00' COMMENT '流量比率', - `is_subscribe` BIT NOT NULL DEFAULT 1 COMMENT '是否允许用户订阅该节点:0-否、1-是', - `is_ddns` BIT NOT NULL DEFAULT 0 COMMENT '是否使用DDNS:0-否、1-是', - `is_relay` BIT NOT NULL DEFAULT 0 COMMENT '是否中转节点:0-否、1-是', - `is_udp` BIT NOT NULL DEFAULT 1 COMMENT '是否启用UDP:0-不启用、1-启用', - `push_port` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '消息推送端口', - `detection_type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '节点检测: 0-关闭、1-只检测TCP、2-只检测ICMP、3-检测全部', - `compatible` BIT NOT NULL DEFAULT 0 COMMENT '兼容SS', - `single` BIT NOT NULL DEFAULT 0 COMMENT '启用单端口功能:0-否、1-是', - `port` SMALLINT(5) UNSIGNED DEFAULT NULL COMMENT '单端口的端口号或连接端口号', - `passwd` VARCHAR(255) DEFAULT NULL COMMENT '单端口的连接密码', - `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序值,值越大越靠前显示', - `status` BIT NOT NULL DEFAULT 1 COMMENT '状态:0-维护、1-正常', - `v2_alter_id` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '16' COMMENT 'V2Ray额外ID', - `v2_port` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'V2Ray服务端口', - `v2_method` VARCHAR(32) NOT NULL DEFAULT 'aes-128-gcm' COMMENT 'V2Ray加密方式', - `v2_net` VARCHAR(16) NOT NULL DEFAULT 'tcp' COMMENT 'V2Ray传输协议', - `v2_type` VARCHAR(32) NOT NULL DEFAULT 'none' COMMENT 'V2Ray伪装类型', - `v2_host` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'V2Ray伪装的域名', - `v2_path` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'V2Ray的WS/H2路径', - `v2_tls` BIT NOT NULL DEFAULT 0 COMMENT 'V2Ray连接TLS:0-未开启、1-开启', - `tls_provider` TEXT DEFAULT NULL COMMENT 'V2Ray节点的TLS提供商授权信息', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`), - INDEX `idx_sub` (`is_subscribe`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点信息表'; - - --- ---------------------------- --- Table structure for ss_node_info --- ---------------------------- -CREATE TABLE `ss_node_info` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', - `uptime` INT(10) UNSIGNED NOT NULL COMMENT '后端存活时长,单位秒', - `load` VARCHAR(255) NOT NULL COMMENT '负载', - `log_time` INT(10) UNSIGNED NOT NULL COMMENT '记录时间', - PRIMARY KEY (`id`), - INDEX `idx_node_id` (`node_id`) USING BTREE -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点心跳信息'; - - --- ---------------------------- --- Table structure for ss_node_online_log --- ---------------------------- -CREATE TABLE `ss_node_online_log` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NOT NULL COMMENT '节点ID', - `online_user` INT(10) UNSIGNED NOT NULL COMMENT '在线用户数', - `log_time` INT(10) UNSIGNED NOT NULL COMMENT '记录时间', - PRIMARY KEY (`id`), - INDEX `idx_node_id` (`node_id`) USING BTREE -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点在线信息'; - - --- ---------------------------- --- Table structure for node_ping --- ---------------------------- -CREATE TABLE `node_ping` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '对应节点id', - `ct` INT(10) NOT NULL DEFAULT '0' COMMENT '电信', - `cu` INT(10) NOT NULL DEFAULT '0' COMMENT '联通', - `cm` INT(10) NOT NULL DEFAULT '0' COMMENT '移动', - `hk` INT(10) NOT NULL DEFAULT '0' COMMENT '香港', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`), - INDEX `idx_node_id` (`node_id`) USING BTREE -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点ping信息表'; - - --- ---------------------------- --- Table structure for node_label --- ---------------------------- -CREATE TABLE `node_label` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', - `label_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '标签ID', - PRIMARY KEY (`id`), - INDEX `idx_node_label` (`node_id`, `label_id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点标签'; - - --- ---------------------------- --- Table structure for user --- ---------------------------- -CREATE TABLE `user` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `username` VARCHAR(64) NOT NULL COMMENT '昵称', - `email` VARCHAR(128) NOT NULL COMMENT '邮箱', - `password` VARCHAR(64) NOT NULL COMMENT '密码', - `port` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '代理端口', - `passwd` VARCHAR(16) NOT NULL COMMENT '代理密码', - `vmess_id` CHAR(36) NOT NULL, - `transfer_enable` BIGINT(20) UNSIGNED NOT NULL DEFAULT '1099511627776' COMMENT '可用流量,单位字节,默认1TiB', - `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '已上传流量,单位字节', - `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '已下载流量,单位字节', - `t` INT(10) UNSIGNED DEFAULT NULL COMMENT '最后使用时间', - `ip` CHAR(15) DEFAULT NULL COMMENT '最后连接IP', - `enable` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '代理状态', - `method` VARCHAR(30) NOT NULL DEFAULT 'aes-256-cfb' COMMENT '加密方式', - `protocol` VARCHAR(30) NOT NULL DEFAULT 'origin' COMMENT '协议', - `protocol_param` VARCHAR(255) DEFAULT NULL COMMENT '协议参数', - `obfs` VARCHAR(30) NOT NULL DEFAULT 'plain' COMMENT '混淆', - `speed_limit` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户限速,为0表示不限速,单位Byte', - `wechat` VARCHAR(30) DEFAULT NULL COMMENT '微信', - `qq` VARCHAR(20) DEFAULT NULL COMMENT 'QQ', - `credit` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '余额,单位分', - `expired_at` DATE NOT NULL DEFAULT '2099-01-01' COMMENT '过期时间', - `ban_time` INT(10) UNSIGNED DEFAULT NULL COMMENT '封禁到期时间', - `remark` TEXT COMMENT '备注', - `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '等级,默认0级', - `group_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '所属分组', - `is_admin` BIT NOT NULL DEFAULT 0 COMMENT '是否管理员:0-否、1-是', - `reg_ip` CHAR(15) NOT NULL DEFAULT '127.0.0.1' COMMENT '注册IP', - `last_login` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后登录时间', - `inviter_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '邀请人', - `reset_time` DATE DEFAULT NULL COMMENT '流量重置日期', - `invite_num` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '可生成邀请码数', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:-1-禁用、0-未激活、1-正常', - `remember_token` VARCHAR(255) DEFAULT NULL, - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`), - UNIQUE INDEX `unq_email` (`email`), - INDEX `idx_search` (`enable`, `status`, `port`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户表'; - -LOCK TABLES `user` WRITE; -/*!40000 ALTER TABLE `user` - DISABLE KEYS */; -INSERT INTO `user`(`id`, `username`, `email`, `password`, `port`, `passwd`, `vmess_id`, `transfer_enable`, `u`, `d`, `t`, `enable`, `method`, `protocol`, `obfs`, `wechat`, `qq`, `credit`, `expired_at`, `remark`, `is_admin`, `reg_ip`, `status`, `created_at`, `updated_at`) -VALUES (1, '管理员', 'test@test.com', '$2y$10$ryMdx5ejvCSdjvZVZAPpOuxHrsAUY8FEINUATy6RCck6j9EeHhPfq', 10000, '@123', 'c6effafd-6046-7a84-376e-b0429751c304', 1099511627776, 0, 0, 0, 1, 'aes-256-cfb', 'origin', 'plain', '', '', 0.00, '2099-01-01', NULL, 1, '127.0.0.1', 1, Now(), Now()); - -/*!40000 ALTER TABLE `user` - ENABLE KEYS */; -UNLOCK TABLES; - - --- ---------------------------- --- Records of `user_group` --- ---------------------------- -CREATE TABLE `user_group` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(255) NOT NULL COMMENT '分组名称', - `nodes` JSON DEFAULT NULL COMMENT '关联的节点ID,多个用,号分隔', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户分组控制表'; - - --- ---------------------------- --- Table structure for `level` --- ---------------------------- -CREATE TABLE `level` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '1' COMMENT '等级', - `name` VARCHAR(100) NOT NULL COMMENT '等级名称', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='等级表'; - - --- ---------------------------- --- Records of `level` --- ---------------------------- -INSERT INTO `level`(`id`, `level`, `name`) -VALUES (1, '0', 'Free'), - (2, '1', 'VIP1'), - (3, '2', 'VIP2'), - (4, '3', 'VIP3'), - (5, '4', 'VIP4'), - (6, '5', 'VIP5'), - (7, '6', 'VIP6'), - (8, '7', 'VIP7'); - - --- ---------------------------- --- Table structure for user_traffic_log --- ---------------------------- -CREATE TABLE `user_traffic_log` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', - `u` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', - `d` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', - `rate` FLOAT(6, 2) UNSIGNED NOT NULL COMMENT '倍率', - `traffic` VARCHAR(32) NOT NULL COMMENT '产生流量', - `log_time` INT(10) UNSIGNED NOT NULL COMMENT '记录时间', - PRIMARY KEY (`id`), - INDEX `idx_user_node_time` (`user_id`, `node_id`, `log_time`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户流量日志'; - - --- ---------------------------- --- Table structure for ss_config --- ---------------------------- -CREATE TABLE `ss_config` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '配置名', - `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-加密方式、2-协议、3-混淆', - `is_default` BIT NOT NULL DEFAULT 0 COMMENT '是否默认:0-不是、1-是', - `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序:值越大排越前', - PRIMARY KEY (`id`) -) ENGINE = InnoDB CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='通用配置'; - - --- ---------------------------- --- Records of ss_config --- ---------------------------- -INSERT INTO `ss_config`(`id`, `name`, `type`, `is_default`, `sort`) -VALUES ('1', 'none', '1', 0, '0'), - ('2', 'rc4', '1', 0, '0'), - ('3', 'rc4-md5', '1', 0, '0'), - ('4', 'rc4-md5-6', '1', 0, '0'), - ('5', 'bf-cfb', '1', 0, '0'), - ('6', 'aes-128-cfb', '1', 0, '0'), - ('7', 'aes-192-cfb', '1', 0, '0'), - ('8', 'aes-256-cfb', '1', 1, '0'), - ('9', 'aes-128-ctr', '1', 0, '0'), - ('10', 'aes-192-ctr', '1', 0, '0'), - ('11', 'aes-256-ctr', '1', 0, '0'), - ('12', 'camellia-128-cfb', '1', 0, '0'), - ('13', 'camellia-192-cfb', '1', 0, '0'), - ('14', 'camellia-256-cfb', '1', 0, '0'), - ('15', 'salsa20', '1', 0, '0'), - ('16', 'xsalsa20', '1', 0, '0'), - ('17', 'chacha20', '1', 0, '0'), - ('18', 'xchacha20', '1', 0, '0'), - ('19', 'chacha20-ietf', '1', 0, '0'), - ('20', 'chacha20-ietf-poly1305', '1', 0, '0'), - ('21', 'chacha20-poly1305', '1', 0, '0'), - ('22', 'xchacha-ietf-poly1305', '1', 0, '0'), - ('23', 'aes-128-gcm', '1', 0, '0'), - ('24', 'aes-192-gcm', '1', 0, '0'), - ('25', 'aes-256-gcm', '1', 0, '0'), - ('26', 'sodium-aes-256-gcm', '1', 0, '0'), - ('27', 'origin', '2', 1, '0'), - ('28', 'auth_sha1_v4', '2', 0, '0'), - ('29', 'auth_aes128_md5', '2', 0, '0'), - ('30', 'auth_aes128_sha1', '2', 0, '0'), - ('31', 'auth_chain_a', '2', 0, '0'), - ('32', 'auth_chain_b', '2', 0, '0'), - ('33', 'plain', '3', 1, '0'), - ('34', 'http_simple', '3', 0, '0'), - ('35', 'http_post', '3', 0, '0'), - ('36', 'tls1.2_ticket_auth', '3', 0, '0'), - ('37', 'tls1.2_ticket_fastauth', '3', 0, '0'), - ('38', 'auth_chain_c', '2', 0, '0'), - ('39', 'auth_chain_d', '2', 0, '0'), - ('40', 'auth_chain_e', '2', 0, '0'), - ('41', 'auth_chain_f', '2', 0, '0'); - - --- ---------------------------- --- Table structure for config --- ---------------------------- -CREATE TABLE `config` -( - `name` VARCHAR(255) NOT NULL COMMENT '配置名', - `value` TEXT NULL COMMENT '配置值', - PRIMARY KEY (`name`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='系统配置'; - - --- ---------------------------- --- Records of config --- ---------------------------- -INSERT INTO `config`(`name`, `value`) -VALUES ('is_rand_port', 0), - ('is_user_rand_port', 0), - ('invite_num', 3), - ('is_register', 1), - ('is_invite_register', 2), - ('website_name', 'ProxyPanel'), - ('is_reset_password', 1), - ('reset_password_times', 3), - ('website_url', 'https://demo.proxypanel.ml'), - ('referral_type', 0), - ('active_times', 3), - ('is_checkin', 1), - ('min_rand_traffic', 10), - ('max_rand_traffic', 500), - ('wechat_qrcode', ''), - ('alipay_qrcode', ''), - ('traffic_limit_time', 1440), - ('referral_traffic', 1024), - ('referral_percent', 0.2), - ('referral_money', 100), - ('referral_status', 1), - ('default_traffic', 1024), - ('traffic_warning', 0), - ('traffic_warning_percent', 80), - ('expire_warning', 0), - ('expire_days', 15), - ('reset_traffic', 1), - ('default_days', 7), - ('subscribe_max', 3), - ('min_port', 10000), - ('max_port', 20000), - ('is_captcha', 0), - ('is_traffic_ban', 1), - ('traffic_ban_value', 10), - ('traffic_ban_time', 60), - ('is_clear_log', 1), - ('is_node_offline', 0), - ('webmaster_email', ''), - ('is_notification', 0), - ('server_chan_key', ''), - ('is_subscribe_ban', 1), - ('subscribe_ban_times', 20), - ('codepay_url', ''), - ('codepay_id', ''), - ('codepay_key', ''), - ('is_free_code', 0), - ('is_forbid_robot', 0), - ('subscribe_domain', ''), - ('auto_release_port', 1), - ('website_callback_url', ''), - ('web_api_url', ''), - ('v2ray_license', ''), - ('trojan_license', ''), - ('v2ray_tls_provider', ''), - ('website_analytics', ''), - ('website_customer_service', ''), - ('register_ip_limit', 5), - ('is_email_filtering', '0'), - ('is_push_bear', 0), - ('push_bear_send_key', ''), - ('push_bear_qrcode', ''), - ('is_ban_status', 0), - ('is_namesilo', 0), - ('namesilo_key', ''), - ('website_logo', ''), - ('website_home_logo', ''), - ('nodes_detection', 0), - ('detection_check_times', 3), - ('is_forbid_china', 0), - ('is_forbid_oversea', 0), - ('AppStore_id', 0), - ('AppStore_password', 0), - ('is_activate_account', 0), - ('node_daily_report', 0), - ('mix_subscribe', 0), - ('rand_subscribe', 0), - ('is_custom_subscribe', 0), - ('is_AliPay', ''), - ('is_QQPay', ''), - ('is_WeChatPay', ''), - ('is_otherPay', ''), - ('alipay_private_key', ''), - ('alipay_public_key', ''), - ('alipay_transport', 'http'), - ('alipay_currency', 'USD'), - ('bitpay_secret', ''), - ('f2fpay_app_id', ''), - ('f2fpay_private_key', ''), - ('f2fpay_public_key', ''), - ('website_security_code', ''), - ('subject_name', ''), - ('geetest_id', ''), - ('geetest_key', ''), - ('google_captcha_sitekey', ''), - ('google_captcha_secret', ''), - ('user_invite_days', 7), - ('admin_invite_days', 7), - ('offline_check_times', ''), - ('payjs_mch_id', ''), - ('payjs_key', ''), - ('maintenance_mode', '0'), - ('maintenance_time', ''), - ('maintenance_content', ''), - ('bark_key', ''), - ('hcaptcha_secret', ''), - ('hcaptcha_sitekey', ''), - ('paypal_username', ''), - ('paypal_password', ''), - ('paypal_secret', ''), - ('paypal_certificate', ''), - ('paypal_app_id', ''), - ('redirect_url', ''), - ('epay_url', ''), - ('epay_mch_id', ''), - ('epay_key', ''); - - --- ---------------------------- --- Table structure for article --- ---------------------------- CREATE TABLE `article` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` TINYINT(1) DEFAULT '1' COMMENT '类型:1-文章、2-站内公告、3-站外公告', - `title` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '标题', - `summary` VARCHAR(255) DEFAULT '' COMMENT '简介', - `logo` VARCHAR(255) DEFAULT '' COMMENT 'LOGO', - `content` TEXT COMMENT '内容', - `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - `deleted_at` DATETIME DEFAULT NULL COMMENT '删除时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-文章、2-站内公告、3-站外公告', + `title` VARCHAR(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '标题', + `summary` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '简介', + `logo` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'LOGO', + `content` TEXT COLLATE utf8mb4_unicode_ci COMMENT '内容', + `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `deleted_at` TIMESTAMP NULL DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='文章'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `config` +( + `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '配置名', + `value` TEXT COLLATE utf8mb4_unicode_ci COMMENT '配置值', + PRIMARY KEY (`name`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + +INSERT INTO `config` (`name`, `value`) +VALUES ('active_times', '3'), + ('admin_invite_days', '7'), + ('alipay_currency', 'USD'), + ('alipay_private_key', NULL), + ('alipay_public_key', NULL), + ('alipay_qrcode', NULL), + ('alipay_transport', 'http'), + ('AppStore_id', NULL), + ('AppStore_password', NULL), + ('auto_release_port', '1'), + ('bark_key', NULL), + ('bitpay_secret', NULL), + ('codepay_id', NULL), + ('codepay_key', NULL), + ('codepay_url', NULL), + ('default_days', '7'), + ('default_traffic', '1024'), + ('detection_check_times', '3'), + ('epay_key', NULL), + ('epay_mch_id', NULL), + ('epay_url', NULL), + ('expire_days', '15'), + ('expire_warning', NULL), + ('f2fpay_app_id', NULL), + ('f2fpay_private_key', NULL), + ('f2fpay_public_key', NULL), + ('geetest_id', NULL), + ('geetest_key', NULL), + ('google_captcha_secret', NULL), + ('google_captcha_sitekey', NULL), + ('hcaptcha_secret', NULL), + ('hcaptcha_sitekey', NULL), + ('invite_num', '3'), + ('is_activate_account', NULL), + ('is_AliPay', NULL), + ('is_ban_status', NULL), + ('is_captcha', NULL), + ('is_checkin', '1'), + ('is_clear_log', '1'), + ('is_custom_subscribe', NULL), + ('is_email_filtering', NULL), + ('is_forbid_china', NULL), + ('is_forbid_oversea', NULL), + ('is_forbid_robot', NULL), + ('is_free_code', NULL), + ('is_invite_register', '2'), + ('is_namesilo', NULL), + ('is_node_offline', NULL), + ('is_notification', NULL), + ('is_otherPay', NULL), + ('is_push_bear', NULL), + ('is_QQPay', NULL), + ('is_rand_port', NULL), + ('is_register', '1'), + ('is_reset_password', '1'), + ('is_subscribe_ban', '1'), + ('is_traffic_ban', '1'), + ('is_user_rand_port', NULL), + ('is_WeChatPay', NULL), + ('maintenance_content', NULL), + ('maintenance_mode', NULL), + ('maintenance_time', NULL), + ('max_port', '65535'), + ('max_rand_traffic', '500'), + ('min_port', '10000'), + ('min_rand_traffic', '10'), + ('mix_subscribe', NULL), + ('namesilo_key', NULL), + ('node_daily_report', NULL), + ('nodes_detection', NULL), + ('offline_check_times', NULL), + ('payjs_key', NULL), + ('payjs_mch_id', NULL), + ('paypal_app_id', NULL), + ('paypal_certificate', NULL), + ('paypal_password', NULL), + ('paypal_secret', NULL), + ('paypal_username', NULL), + ('push_bear_qrcode', NULL), + ('push_bear_send_key', NULL), + ('rand_subscribe', NULL), + ('redirect_url', NULL), + ('referral_money', '100'), + ('referral_percent', '0.2'), + ('referral_status', '1'), + ('referral_traffic', '1024'), + ('referral_type', NULL), + ('register_ip_limit', '5'), + ('reset_password_times', '3'), + ('reset_traffic', '1'), + ('server_chan_key', NULL), + ('subject_name', NULL), + ('subscribe_ban_times', '20'), + ('subscribe_domain', NULL), + ('subscribe_max', '3'), + ('traffic_ban_time', '60'), + ('traffic_ban_value', '10'), + ('traffic_limit_time', '1440'), + ('traffic_warning', NULL), + ('traffic_warning_percent', '80'), + ('trojan_license', NULL), + ('user_invite_days', '7'), + ('v2ray_license', NULL), + ('v2ray_tls_provider', NULL), + ('web_api_url', NULL), + ('webmaster_email', NULL), + ('website_analytics', NULL), + ('website_callback_url', NULL), + ('website_customer_service', NULL), + ('website_home_logo', NULL), + ('website_logo', NULL), + ('website_name', 'ProxyPanel'), + ('website_security_code', NULL), + ('website_url', 'https://demo.proxypanel.ml'), + ('wechat_qrcode', NULL); + +CREATE TABLE `country` +( + `code` CHAR(2) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'ISO国家代码', + `name` VARCHAR(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称', + PRIMARY KEY (`code`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + +INSERT INTO `country` (`code`, `name`) +VALUES ('ae', '阿联酋'), + ('ar', '阿根廷'), + ('au', '澳大利亚'), + ('be', '比利时'), + ('bg', '保加利亚'), + ('br', '巴西'), + ('ca', '加拿大'), + ('ch', '瑞士'), + ('cn', '中国'), + ('co', '哥伦比亚'), + ('cz', '捷克'), + ('de', '德国'), + ('dk', '丹麦'), + ('eg', '埃及'), + ('es', '西班牙'), + ('fi', '芬兰'), + ('fr', '法国'), + ('gr', '希腊'), + ('hk', '香港'), + ('hu', '匈牙利'), + ('id', '印度尼西亚'), + ('ie', '爱尔兰'), + ('il', '以色列'), + ('in', '印度'), + ('iq', '伊拉克'), + ('ir', '伊朗'), + ('is', '冰岛'), + ('it', '意大利'), + ('jp', '日本'), + ('ke', '肯尼亚'), + ('kr', '韩国'), + ('kz', '哈萨克斯坦'), + ('lt', '立陶宛'), + ('lu', '卢森堡'), + ('md', '摩尔多瓦'), + ('mm', '缅甸'), + ('mo', '澳门'), + ('mx', '墨西哥'), + ('my', '马来西亚'), + ('nl', '荷兰'), + ('no', '挪威'), + ('nz', '纽西兰'), + ('ph', '菲律宾'), + ('pk', '巴基斯坦'), + ('pl', '波兰'), + ('pt', '葡萄牙'), + ('ro', '罗马尼亚'), + ('ru', '俄罗斯'), + ('se', '瑞典'), + ('sg', '新加坡'), + ('th', '泰国'), + ('tr', '土耳其'), + ('tw', '台湾'), + ('ua', '乌克兰'), + ('uk', '英国'), + ('us', '美国'), + ('vn', '越南'), + ('za', '南非'); + +CREATE TABLE `coupon` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` VARCHAR(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '优惠券名称', + `logo` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '优惠券LOGO', + `sn` VARCHAR(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '优惠券码', + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-抵用券、2-折扣券、3-充值券', + `usable_times` SMALLINT(5) UNSIGNED DEFAULT NULL COMMENT '可使用次数', + `value` INT(10) UNSIGNED NOT NULL COMMENT '折扣金额(元)/折扣力度', + `rule` INT(10) UNSIGNED DEFAULT NULL COMMENT '使用限制(元)', + `start_time` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '有效期开始', + `end_time` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '有效期结束', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-未使用、1-已使用、2-已失效', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `deleted_at` TIMESTAMP NULL DEFAULT NULL COMMENT '删除时间', + PRIMARY KEY (`id`), + UNIQUE KEY `coupon_sn_unique` (`sn`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `coupon_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `coupon_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '优惠券ID', + `goods_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品ID', + `order_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单ID', + `description` VARCHAR(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `email_filter` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-黑名单、2-白名单', + `words` VARCHAR(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '敏感词', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + +INSERT INTO `email_filter` (`id`, `type`, `words`) +VALUES (1, 1, 'chacuo.com'), + (2, 1, '1766258.com'), + (3, 1, '3202.com'), + (4, 1, '4057.com'), + (5, 1, '4059.com'), + (6, 1, 'a7996.com'), + (7, 1, 'bccto.me'), + (8, 1, 'bnuis.com'), + (9, 1, 'chaichuang.com'), + (10, 1, 'cr219.com'), + (11, 1, 'cuirushi.org'), + (12, 1, 'dawin.com'), + (13, 1, 'jiaxin8736.com'), + (14, 1, 'lakqs.com'), + (15, 1, 'urltc.com'), + (16, 1, '027168.com'), + (17, 1, '10minutemail.net'), + (18, 1, '11163.com'), + (19, 1, '1shivom.com'), + (20, 1, 'auoie.com'), + (21, 1, 'bareed.ws'), + (22, 1, 'bit-degree.com'), + (23, 1, 'cjpeg.com'), + (24, 1, 'cool.fr.nf'), + (25, 1, 'courriel.fr.nf'), + (26, 1, 'disbox.net'), + (27, 1, 'disbox.org'), + (28, 1, 'fidelium10.com'), + (29, 1, 'get365.pw'), + (30, 1, 'ggr.la'), + (31, 1, 'grr.la'), + (32, 1, 'guerrillamail.biz'), + (33, 1, 'guerrillamail.com'), + (34, 1, 'guerrillamail.de'), + (35, 1, 'guerrillamail.net'), + (36, 1, 'guerrillamail.org'), + (37, 1, 'guerrillamailblock.com'), + (38, 1, 'hubii-network.com'), + (39, 1, 'hurify1.com'), + (40, 1, 'itoup.com'), + (41, 1, 'jetable.fr.nf'), + (42, 1, 'jnpayy.com'), + (43, 1, 'juyouxi.com'), + (44, 1, 'mail.bccto.me'), + (45, 1, 'www.bccto.me'), + (46, 1, 'mega.zik.dj'), + (47, 1, 'moakt.co'), + (48, 1, 'moakt.ws'), + (49, 1, 'molms.com'), + (50, 1, 'moncourrier.fr.nf'), + (51, 1, 'monemail.fr.nf'), + (52, 1, 'monmail.fr.nf'), + (53, 1, 'nomail.xl.cx'), + (54, 1, 'nospam.ze.tc'), + (55, 1, 'pay-mon.com'), + (56, 1, 'poly-swarm.com'), + (57, 1, 'sgmh.online'), + (58, 1, 'sharklasers.com'), + (59, 1, 'shiftrpg.com'), + (60, 1, 'spam4.me'), + (61, 1, 'speed.1s.fr'), + (62, 1, 'tmail.ws'), + (63, 1, 'tmails.net'), + (64, 1, 'tmpmail.net'), + (65, 1, 'tmpmail.org'), + (66, 1, 'travala10.com'), + (67, 1, 'yopmail.com'), + (68, 1, 'yopmail.fr'), + (69, 1, 'yopmail.net'), + (70, 1, 'yuoia.com'), + (71, 1, 'zep-hyr.com'), + (72, 1, 'zippiex.com'), + (73, 1, 'lrc8.com'), + (74, 1, '1otc.com'), + (75, 1, 'emailna.co'), + (76, 1, 'mailinator.com'), + (77, 1, 'nbzmr.com'), + (78, 1, 'awsoo.com'), + (79, 1, 'zhcne.com'), + (80, 1, '0box.eu'), + (81, 1, 'contbay.com'), + (82, 1, 'damnthespam.com'), + (83, 1, 'kurzepost.de'), + (84, 1, 'objectmail.com'), + (85, 1, 'proxymail.eu'), + (86, 1, 'rcpt.at'), + (87, 1, 'trash-mail.at'), + (88, 1, 'trashmail.at'), + (89, 1, 'trashmail.com'), + (90, 1, 'trashmail.io'), + (91, 1, 'trashmail.me'), + (92, 1, 'trashmail.net'), + (93, 1, 'wegwerfmail.de'), + (94, 1, 'wegwerfmail.net'), + (95, 1, 'wegwerfmail.org'), + (96, 1, 'nwytg.net'), + (97, 1, 'despam.it'), + (98, 1, 'spambox.us'), + (99, 1, 'spam.la'), + (100, 1, 'mytrashmail.com'), + (101, 1, 'mt2014.com'), + (102, 1, 'mt2015.com'), + (103, 1, 'thankyou2010.com'), + (104, 1, 'trash2009.com'), + (105, 1, 'mt2009.com'), + (106, 1, 'trashymail.com'), + (107, 1, 'tempemail.net'), + (108, 1, 'slopsbox.com'), + (109, 1, 'mailnesia.com'), + (110, 1, 'ezehe.com'), + (111, 1, 'tempail.com'), + (112, 1, 'newairmail.com'), + (113, 1, 'temp-mail.org'), + (114, 1, 'linshiyouxiang.net'), + (115, 1, 'zwoho.com'), + (116, 1, 'mailboxy.fun'), + (117, 1, 'crypto-net.club'), + (118, 1, 'guerrillamail.info'), + (119, 1, 'pokemail.net'), + (120, 1, 'odmail.cn'), + (121, 1, 'hlooy.com'), + (122, 1, 'ozlaq.com'), + (123, 1, '666email.com'), + (124, 1, 'linshiyou.com'), + (125, 1, 'linshiyou.pl'), + (126, 1, 'woyao.pl'), + (127, 1, 'yaowo.pl'), + (128, 2, 'qq.com'), + (129, 2, '163.com'), + (130, 2, '126.com'), + (131, 2, '189.com'), + (132, 2, 'sohu.com'), + (133, 2, 'gmail.com'), + (134, 2, 'outlook.com'), + (135, 2, 'icloud.com'); + +CREATE TABLE `failed_jobs` +( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `connection` TEXT COLLATE utf8mb4_unicode_ci NOT NULL, + `queue` TEXT COLLATE utf8mb4_unicode_ci NOT NULL, + `payload` LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL, + `exception` LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL, + `failed_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `goods` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` VARCHAR(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '商品名称', + `logo` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品图片地址', + `traffic` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品内含多少流量,单位MiB', + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '商品类型:1-流量包、2-套餐', + `price` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '售价,单位分', + `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '购买后给用户授权的等级', + `renew` INT(10) UNSIGNED DEFAULT NULL COMMENT '流量重置价格,单位分', + `period` INT(10) UNSIGNED DEFAULT NULL COMMENT '流量自动重置周期', + `info` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品信息', + `description` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '商品描述', + `days` INT(10) UNSIGNED NOT NULL DEFAULT '30' COMMENT '有效期', + `invite_num` INT(10) UNSIGNED DEFAULT NULL COMMENT '赠送邀请码数', + `limit_num` INT(10) UNSIGNED DEFAULT NULL COMMENT '限购数量,默认为null不限购', + `color` VARCHAR(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'green' COMMENT '商品颜色', + `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序', + `is_hot` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否热销:0-否、1-是', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-下架、1-上架', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `deleted_at` TIMESTAMP NULL DEFAULT NULL COMMENT '删除时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for invite --- ---------------------------- CREATE TABLE `invite` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `inviter_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '邀请ID', - `invitee_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '受邀ID', - `code` CHAR(32) NOT NULL COMMENT '邀请码', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '邀请码状态:0-未使用、1-已使用、2-已过期', - `dateline` DATETIME NOT NULL COMMENT '有效期至', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - `deleted_at` DATETIME DEFAULT NULL COMMENT '删除时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='邀请码表'; + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `inviter_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '邀请ID', + `invitee_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '受邀ID', + `code` CHAR(12) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邀请码', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '邀请码状态:0-未使用、1-已使用、2-已过期', + `dateline` DATETIME NOT NULL COMMENT '有效期至', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `deleted_at` TIMESTAMP NULL DEFAULT NULL COMMENT '删除时间', + PRIMARY KEY (`id`), + UNIQUE KEY `invite_code_unique` (`code`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `jobs` +( + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, + `queue` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `payload` LONGTEXT COLLATE utf8mb4_unicode_ci NOT NULL, + `attempts` TINYINT(3) UNSIGNED NOT NULL, + `reserved_at` INT(10) UNSIGNED DEFAULT NULL, + `available_at` INT(10) UNSIGNED NOT NULL, + `created_at` INT(10) UNSIGNED NOT NULL, + PRIMARY KEY (`id`), + KEY `jobs_queue_index` (`queue`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for label --- ---------------------------- CREATE TABLE `label` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '名称', - `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序值', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称', + `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序值', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='标签'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; - --- ---------------------------- --- Records of label --- ---------------------------- -INSERT INTO `label`(`id`, `name`, `sort`) +INSERT INTO `label` (`id`, `name`, `sort`) VALUES (1, 'Netflix', 0), (2, 'Hulu', 0), (3, 'HBO', 0), @@ -502,268 +481,293 @@ VALUES (1, 'Netflix', 0), (9, 'Happyon', 0), (10, 'AbemeTV', 0), (11, 'DMM', 0), - (12, 'Niconico', 0), - (13, 'DAZN', 0), - (14, 'pixiv', 0), - (15, 'TVer', 0), - (16, 'TVB', 0), - (17, 'HBO Go', 0), - (18, 'Bilibili 港澳台', 0), - (19, 'Viu', 0), - (20, '動畫瘋', 0), - (21, '四季線上影視', 0), - (22, 'LINE TV', 0), - (23, 'Youtube Premium', 0), - (24, '优酷', 0), - (25, '爱奇艺', 0), - (26, '腾讯视频', 0), - (27, '搜狐视频', 0), - (28, 'PP视频', 0), - (29, '凤凰视频', 0), - (30, '百度视频', 0), - (31, '芒果TV', 0), - (32, '土豆网', 0), - (33, '哔哩哔哩', 0), - (34, '网易云音乐', 0), - (35, 'Bahamut', 0), - (36, 'Deezer', 0), - (37, 'DisneyPlus', 0), - (38, 'HWTV', 0), - (39, 'ITV', 0), - (40, 'JOOX', 0), - (41, 'KKBOX', 0), - (42, 'KKTV', 0), - (43, 'LiTV', 0), - (44, 'My5', 0), - (45, 'PBS', 0), - (46, 'Pandora', 0), - (47, 'SoundCloud', 0), - (48, 'Spotify', 0), - (49, 'TIDAL', 0), - (50, 'TaiWanGood', 0), - (51, 'TikTok', 0), - (52, 'Pornhub', 0), - (53, 'Twitch', 0), - (54, 'ViuTV', 0), - (55, 'encoreTVB', 0), - (56, 'myTV_SUPER', 0), - (57, 'niconico', 0), - (58, 'QQ音乐', 0); + (12, 'NicoNico', 0), + (13, 'Pixiv', 0), + (14, 'TVer', 0), + (15, 'TVB', 0), + (16, 'HBO Go', 0), + (17, 'BiliBili港澳台', 0), + (18, '動畫瘋', 0), + (19, '四季線上影視', 0), + (20, 'LINE TV', 0), + (21, 'Youtube Premium', 0), + (22, '中国视频网站', 0), + (23, '网易云音乐', 0), + (24, 'QQ音乐', 0), + (25, 'DisneyPlus', 0), + (26, 'Pandora', 0), + (27, 'SoundCloud', 0), + (28, 'Spotify', 0), + (29, 'TIDAL', 0), + (30, 'TikTok', 0), + (31, 'Pornhub', 0), + (32, 'Twitch', 0); - --- ---------------------------- --- Table structure for verify --- ---------------------------- -CREATE TABLE `verify` +CREATE TABLE `level` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '激活类型:1-自行激活、2-管理员激活', - `user_id` INT(10) UNSIGNED NOT NULL COMMENT '用户ID', - `token` VARCHAR(32) NOT NULL COMMENT '校验token', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-未使用、1-已使用、2-已失效', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `level` TINYINT(3) UNSIGNED NOT NULL COMMENT '等级', + `name` VARCHAR(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '等级名称', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='账号激活邮件地址'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; +INSERT INTO `level` (`id`, `level`, `name`) +VALUES (1, 0, 'Free'), + (2, 1, 'VIP-1'), + (3, 2, 'VIP-2'), + (4, 3, 'VIP-3'), + (5, 4, 'VIP-4'), + (6, 5, 'VIP-5'), + (7, 6, 'VIP-6'), + (8, 7, 'VIP-7'); --- ---------------------------- --- Table structure for verify_code --- ---------------------------- -CREATE TABLE `verify_code` +CREATE TABLE `marketing` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `address` VARCHAR(128) NOT NULL COMMENT '用户邮箱', - `code` CHAR(6) NOT NULL COMMENT '验证码', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-未使用、1-已使用、2-已失效', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` TINYINT(1) NOT NULL COMMENT '类型:1-邮件群发', + `receiver` TEXT COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '接收者', + `title` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '标题', + `content` TEXT COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '内容', + `error` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '错误信息', + `status` TINYINT(1) NOT NULL COMMENT '状态:-1-失败、0-待发送、1-成功', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='注册激活验证码'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for goods --- ---------------------------- -CREATE TABLE `goods` +CREATE TABLE `migrations` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(100) NOT NULL DEFAULT '' COMMENT '商品名称', - `logo` VARCHAR(255) DEFAULT NULL COMMENT '商品图片地址', - `traffic` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品内含多少流量,单位MiB', - `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '商品类型:1-流量包、2-套餐', - `price` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '售价,单位分', - `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '购买后给用户授权的等级', - `renew` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '流量重置价格,单位分', - `period` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '流量自动重置周期', - `info` VARCHAR(255) DEFAULT '' COMMENT '商品信息', - `description` VARCHAR(255) DEFAULT '' COMMENT '商品描述', - `days` INT(10) UNSIGNED NOT NULL DEFAULT '30' COMMENT '有效期', - `invite_num` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '赠送邀请码数', - `limit_num` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '限购数量,默认为0不限购', - `color` VARCHAR(50) NOT NULL DEFAULT 'green' COMMENT '商品颜色', - `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序', - `is_hot` BIT NOT NULL DEFAULT 0 COMMENT '是否热销:0-否、1-是', - `status` BIT NOT NULL DEFAULT 1 COMMENT '状态:0-下架、1-上架', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - `deleted_at` DATETIME DEFAULT NULL COMMENT '删除时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `migration` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `batch` INT(11) NOT NULL, PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='商品'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; +INSERT INTO `migrations` (`id`, `migration`, `batch`) +VALUES (1, '2020_08_21_145711_create_article_table', 1), + (2, '2020_08_21_145711_create_config_table', 1), + (3, '2020_08_21_145711_create_country_table', 1), + (4, '2020_08_21_145711_create_coupon_log_table', 1), + (5, '2020_08_21_145711_create_coupon_table', 1), + (6, '2020_08_21_145711_create_email_filter_table', 1), + (7, '2020_08_21_145711_create_failed_jobs_table', 1), + (8, '2020_08_21_145711_create_goods_table', 1), + (9, '2020_08_21_145711_create_invite_table', 1), + (10, '2020_08_21_145711_create_jobs_table', 1), + (11, '2020_08_21_145711_create_label_table', 1), + (12, '2020_08_21_145711_create_level_table', 1), + (13, '2020_08_21_145711_create_marketing_table', 1), + (14, '2020_08_21_145711_create_node_auth_table', 1), + (15, '2020_08_21_145711_create_node_certificate_table', 1), + (16, '2020_08_21_145711_create_node_daily_data_flow_table', 1), + (17, '2020_08_21_145711_create_node_hourly_data_flow_table', 1), + (18, '2020_08_21_145711_create_node_label_table', 1), + (19, '2020_08_21_145711_create_node_ping_table', 1), + (20, '2020_08_21_145711_create_node_rule_table', 1), + (21, '2020_08_21_145711_create_notification_log_table', 1), + (22, '2020_08_21_145711_create_order_table', 1), + (23, '2020_08_21_145711_create_payment_callback_table', 1), + (24, '2020_08_21_145711_create_payment_table', 1), + (25, '2020_08_21_145711_create_products_pool_table', 1), + (26, '2020_08_21_145711_create_referral_apply_table', 1), + (27, '2020_08_21_145711_create_referral_log_table', 1), + (28, '2020_08_21_145711_create_rule_group_node_table', 1), + (29, '2020_08_21_145711_create_rule_group_table', 1), + (30, '2020_08_21_145711_create_rule_log_table', 1), + (31, '2020_08_21_145711_create_rule_table', 1), + (32, '2020_08_21_145711_create_ss_config_table', 1), + (33, '2020_08_21_145711_create_ss_node_info_table', 1), + (34, '2020_08_21_145711_create_ss_node_ip_table', 1), + (35, '2020_08_21_145711_create_ss_node_online_log_table', 1), + (36, '2020_08_21_145711_create_ss_node_table', 1), + (37, '2020_08_21_145711_create_ticket_reply_table', 1), + (38, '2020_08_21_145711_create_ticket_table', 1), + (39, '2020_08_21_145711_create_user_baned_log_table', 1), + (40, '2020_08_21_145711_create_user_credit_log_table', 1), + (41, '2020_08_21_145711_create_user_daily_data_flow_table', 1), + (42, '2020_08_21_145711_create_user_data_modify_log_table', 1), + (43, '2020_08_21_145711_create_user_group_table', 1), + (44, '2020_08_21_145711_create_user_hourly_data_flow_table', 1), + (45, '2020_08_21_145711_create_user_login_log_table', 1), + (46, '2020_08_21_145711_create_user_subscribe_log_table', 1), + (47, '2020_08_21_145711_create_user_subscribe_table', 1), + (48, '2020_08_21_145711_create_user_table', 1), + (49, '2020_08_21_145711_create_user_traffic_log_table', 1), + (50, '2020_08_21_145711_create_verify_code_table', 1), + (51, '2020_08_21_145711_create_verify_table', 1), + (52, '2020_08_21_150711_preset_data', 1); --- ---------------------------- --- Table structure for coupon --- ---------------------------- -CREATE TABLE `coupon` +CREATE TABLE `node_auth` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(50) NOT NULL COMMENT '优惠券名称', - `logo` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '优惠券LOGO', - `sn` VARCHAR(50) NOT NULL COMMENT '优惠券码', - `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-抵用券、2-折扣券、3-充值券', - `usable_times` SMALLINT UNSIGNED DEFAULT NULL COMMENT '可使用次数', - `value` INT(10) UNSIGNED NOT NULL COMMENT '折扣金额(元)/折扣力度', - `rule` INT(10) UNSIGNED DEFAULT NULL COMMENT '使用限制(元)', - `start_time` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '有效期开始', - `end_time` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '有效期结束', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-未使用、1-已使用、2-已失效', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - `deleted_at` DATETIME DEFAULT NULL COMMENT '删除时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `node_id` INT(10) UNSIGNED NOT NULL COMMENT '授权节点ID', + `key` CHAR(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '认证KEY', + `secret` CHAR(8) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '通信密钥', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `node_certificate` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `domain` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '域名', + `key` TEXT COLLATE utf8mb4_unicode_ci COMMENT '域名证书KEY', + `pem` TEXT COLLATE utf8mb4_unicode_ci COMMENT '域名证书PEM', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `node_daily_data_flow` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', + `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', + `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', + `total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '总流量', + `traffic` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '总流量(带单位)', + `created_at` DATETIME NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`), - UNIQUE INDEX `unq_sn` (`sn`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='优惠券'; + KEY `node_daily_data_flow_node_id_index` (`node_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for coupon_log --- ---------------------------- -CREATE TABLE `coupon_log` +CREATE TABLE `node_hourly_data_flow` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `coupon_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '优惠券ID', - `goods_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品ID', - `order_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单ID', - `description` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '备注', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='优惠券使用日志'; + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', + `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', + `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', + `total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '总流量', + `traffic` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '总流量(带单位)', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `node_hourly_data_flow_node_id_index` (`node_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for products_pool --- ---------------------------- -CREATE TABLE `products_pool` +CREATE TABLE `node_label` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', + `label_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '标签ID', + PRIMARY KEY (`id`), + KEY `idx_node_label` (`node_id`, `label_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `node_ping` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `name` VARCHAR(255) NOT NULL COMMENT '名称', - `min_amount` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '适用最小金额,单位分', - `max_amount` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '适用最大金额,单位分', - `status` BIT NOT NULL DEFAULT 1 COMMENT '状态:0-未启用、1-已启用', + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '对应节点id', + `ct` INT(11) NOT NULL DEFAULT '0' COMMENT '电信', + `cu` INT(11) NOT NULL DEFAULT '0' COMMENT '联通', + `cm` INT(11) NOT NULL DEFAULT '0' COMMENT '移动', + `hk` INT(11) NOT NULL DEFAULT '0' COMMENT '香港', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `node_ping_node_id_index` (`node_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `node_rule` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `node_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '节点ID', + `rule_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '审计规则ID', + `is_black` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '是否黑名单模式:0-不是、1-是', `created_at` DATETIME NOT NULL COMMENT '创建时间', `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='产品名称池'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `notification_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-邮件、2-ServerChan、3-Bark、4-Telegram', + `address` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '收信地址', + `title` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '标题', + `content` TEXT COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '内容', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:-1发送失败、0-等待发送、1-发送成功', + `error` TEXT COLLATE utf8mb4_unicode_ci COMMENT '发送失败抛出的异常信息', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for order --- ---------------------------- CREATE TABLE `order` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `order_sn` VARCHAR(20) NOT NULL DEFAULT '' COMMENT '订单编号', - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '操作人', - `goods_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品ID', - `coupon_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '优惠券ID', - `origin_amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单原始总价,单位分', - `amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单总价,单位分', - `expired_at` DATETIME DEFAULT NULL COMMENT '过期时间', - `is_expire` BIT NOT NULL DEFAULT 0 COMMENT '是否已过期:0-未过期、1-已过期', - `pay_type` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '支付渠道:0-余额、1-支付宝、2-QQ、3-微信、4-虚拟货币、5-paypal', - `pay_way` VARCHAR(10) NOT NULL DEFAULT '' COMMENT '支付方式:balance、f2fpay、codepay、payjs、bitpayx等', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '订单状态:-1-已关闭、0-待支付、1-已支付待确认、2-已完成', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `order_sn` VARCHAR(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '订单编号', + `user_id` INT(10) UNSIGNED NOT NULL COMMENT '操作人', + `goods_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '商品ID', + `coupon_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '优惠券ID', + `origin_amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单原始总价,单位分', + `amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单总价,单位分', + `expired_at` DATETIME DEFAULT NULL COMMENT '过期时间', + `is_expire` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否已过期:0-未过期、1-已过期', + `pay_type` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '支付渠道:0-余额、1-支付宝、2-QQ、3-微信、4-虚拟货币、5-paypal', + `pay_way` VARCHAR(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'balance' COMMENT '支付方式:balance、f2fpay、codepay、payjs、bitpayx等', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '订单状态:-1-已关闭、0-待支付、1-已支付待确认、2-已完成', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`), - INDEX `idx_order_search` (`user_id`, `goods_id`, `is_expire`, `status`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='订单'; + KEY `idx_order_search` (`user_id`, `goods_id`, `is_expire`, `status`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for ticket --- --------------------------- -CREATE TABLE `ticket` +CREATE TABLE `payment` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `admin_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理员ID', - `title` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '标题', - `content` TEXT NOT NULL COMMENT '内容', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-待处理、1-已处理未关闭、2-已关闭', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `trade_no` VARCHAR(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '支付单号(本地订单号)', + `user_id` INT(10) UNSIGNED NOT NULL COMMENT '用户ID', + `order_id` INT(10) UNSIGNED NOT NULL COMMENT '本地订单ID', + `amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '金额,单位分', + `qr_code` TEXT COLLATE utf8mb4_unicode_ci COMMENT '支付二维码', + `url` TEXT COLLATE utf8mb4_unicode_ci COMMENT '支付链接', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '支付状态:-1-支付失败、0-等待支付、1-支付成功', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='工单'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for ticket_reply --- ---------------------------- -CREATE TABLE `ticket_reply` +CREATE TABLE `payment_callback` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `ticket_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '工单ID', - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '回复用户ID', - `admin_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理员ID', - `content` TEXT NOT NULL COMMENT '回复内容', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `trade_no` VARCHAR(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '本地订单号', + `out_trade_no` VARCHAR(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '外部订单号(支付平台)', + `amount` INT(10) UNSIGNED NOT NULL COMMENT '交易金额,单位分', + `status` TINYINT(1) NOT NULL COMMENT '交易状态:0-失败、1-成功', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='工单回复'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for user_credit_log --- ---------------------------- -CREATE TABLE `user_credit_log` +CREATE TABLE `products_pool` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '账号ID', - `order_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单ID', - `before` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发生前余额,单位分', - `after` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发生后金额,单位分', - `amount` INT(10) NOT NULL DEFAULT '0' COMMENT '发生金额,单位分', - `description` VARCHAR(255) DEFAULT '' COMMENT '操作描述', - `created_at` DATETIME NOT NULL COMMENT '创建时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称', + `min_amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '适用最小金额,单位分', + `max_amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '适用最大金额,单位分', + `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态:0-未启用、1-已启用', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户余额变动日志'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for user_data_modify_log --- ---------------------------- -CREATE TABLE `user_data_modify_log` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `order_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发生的订单ID', - `before` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '操作前流量', - `after` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '操作后流量', - `description` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '描述', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户流量变动日志'; - - --- ---------------------------- --- Table structure for referral_apply --- ---------------------------- CREATE TABLE `referral_apply` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `user_id` INT(10) UNSIGNED NOT NULL COMMENT '用户ID', `before` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '操作前可提现金额,单位分', `after` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '操作后可提现金额,单位分', `amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '本次提现金额,单位分', @@ -772,12 +776,9 @@ CREATE TABLE `referral_apply` `created_at` DATETIME NOT NULL COMMENT '创建时间', `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='提现申请'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for referral_log --- ---------------------------- CREATE TABLE `referral_log` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, @@ -786,545 +787,55 @@ CREATE TABLE `referral_log` `order_id` INT(10) UNSIGNED NOT NULL COMMENT '关联订单ID', `amount` INT(10) UNSIGNED NOT NULL COMMENT '消费金额,单位分', `commission` INT(10) UNSIGNED NOT NULL COMMENT '返利金额', - `status` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '状态:0-未提现、1-审核中、2-已提现', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-未提现、1-审核中、2-已提现', `created_at` DATETIME NOT NULL COMMENT '创建时间', `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='消费返利日志'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for notification_log --- ---------------------------- -CREATE TABLE `notification_log` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-邮件、2-ServerChan、3-Bark、4-Telegram', - `address` VARCHAR(255) NOT NULL COMMENT '收信地址', - `title` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '标题', - `content` TEXT NOT NULL COMMENT '内容', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:-1发送失败、0-等待发送、1-发送成功', - `error` TEXT COMMENT '发送失败抛出的异常信息', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='通知投递记录'; - - --- ---------------------------- --- Table structure for email_filter --- ---------------------------- -CREATE TABLE `email_filter` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-黑名单、2-白名单', - `words` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '敏感词', - PRIMARY KEY (`id`) -) ENGINE = myisam DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='敏感词'; - - --- ---------------------------- --- Records of email_filter --- ---------------------------- -INSERT INTO `email_filter`(`type`, `words`) -VALUES ('1', 'chacuo.com'), - ('1', '1766258.com'), - ('1', '3202.com'), - ('1', '4057.com'), - ('1', '4059.com'), - ('1', 'a7996.com'), - ('1', 'bccto.me'), - ('1', 'bnuis.com'), - ('1', 'chaichuang.com'), - ('1', 'cr219.com'), - ('1', 'cuirushi.org'), - ('1', 'dawin.com'), - ('1', 'jiaxin8736.com'), - ('1', 'lakqs.com'), - ('1', 'urltc.com'), - ('1', '027168.com'), - ('1', '10minutemail.net'), - ('1', '11163.com'), - ('1', '1shivom.com'), - ('1', 'auoie.com'), - ('1', 'bareed.ws'), - ('1', 'bit-degree.com'), - ('1', 'cjpeg.com'), - ('1', 'cool.fr.nf'), - ('1', 'courriel.fr.nf'), - ('1', 'disbox.net'), - ('1', 'disbox.org'), - ('1', 'fidelium10.com'), - ('1', 'get365.pw'), - ('1', 'ggr.la'), - ('1', 'grr.la'), - ('1', 'guerrillamail.biz'), - ('1', 'guerrillamail.com'), - ('1', 'guerrillamail.de'), - ('1', 'guerrillamail.net'), - ('1', 'guerrillamail.org'), - ('1', 'guerrillamailblock.com'), - ('1', 'hubii-network.com'), - ('1', 'hurify1.com'), - ('1', 'itoup.com'), - ('1', 'jetable.fr.nf'), - ('1', 'jnpayy.com'), - ('1', 'juyouxi.com'), - ('1', 'mail.bccto.me'), - ('1', 'www.bccto.me'), - ('1', 'mega.zik.dj'), - ('1', 'moakt.co'), - ('1', 'moakt.ws'), - ('1', 'molms.com'), - ('1', 'moncourrier.fr.nf'), - ('1', 'monemail.fr.nf'), - ('1', 'monmail.fr.nf'), - ('1', 'nomail.xl.cx'), - ('1', 'nospam.ze.tc'), - ('1', 'pay-mon.com'), - ('1', 'poly-swarm.com'), - ('1', 'sgmh.online'), - ('1', 'sharklasers.com'), - ('1', 'shiftrpg.com'), - ('1', 'spam4.me'), - ('1', 'speed.1s.fr'), - ('1', 'tmail.ws'), - ('1', 'tmails.net'), - ('1', 'tmpmail.net'), - ('1', 'tmpmail.org'), - ('1', 'travala10.com'), - ('1', 'yopmail.com'), - ('1', 'yopmail.fr'), - ('1', 'yopmail.net'), - ('1', 'yuoia.com'), - ('1', 'zep-hyr.com'), - ('1', 'zippiex.com'), - ('1', 'lrc8.com'), - ('1', '1otc.com'), - ('1', 'emailna.co'), - ('1', 'mailinator.com'), - ('1', 'nbzmr.com'), - ('1', 'awsoo.com'), - ('1', 'zhcne.com'), - ('1', '0box.eu'), - ('1', 'contbay.com'), - ('1', 'damnthespam.com'), - ('1', 'kurzepost.de'), - ('1', 'objectmail.com'), - ('1', 'proxymail.eu'), - ('1', 'rcpt.at'), - ('1', 'trash-mail.at'), - ('1', 'trashmail.at'), - ('1', 'trashmail.com'), - ('1', 'trashmail.io'), - ('1', 'trashmail.me'), - ('1', 'trashmail.net'), - ('1', 'wegwerfmail.de'), - ('1', 'wegwerfmail.net'), - ('1', 'wegwerfmail.org'), - ('1', 'nwytg.net'), - ('1', 'despam.it'), - ('1', 'spambox.us'), - ('1', 'spam.la'), - ('1', 'mytrashmail.com'), - ('1', 'mt2014.com'), - ('1', 'mt2015.com'), - ('1', 'thankyou2010.com'), - ('1', 'trash2009.com'), - ('1', 'mt2009.com'), - ('1', 'trashymail.com'), - ('1', 'tempemail.net'), - ('1', 'slopsbox.com'), - ('1', 'mailnesia.com'), - ('1', 'ezehe.com'), - ('1', 'tempail.com'), - ('1', 'newairmail.com'), - ('1', 'temp-mail.org'), - ('1', 'linshiyouxiang.net'), - ('1', 'zwoho.com'), - ('1', 'mailboxy.fun'), - ('1', 'crypto-net.club'), - ('1', 'guerrillamail.info'), - ('1', 'pokemail.net'), - ('1', 'odmail.cn'), - ('1', 'hlooy.com'), - ('1', 'ozlaq.com'), - ('1', '666email.com'), - ('1', 'linshiyou.com'), - ('1', 'linshiyou.pl'), - ('1', 'woyao.pl'), - ('1', 'yaowo.pl'), - ('2', 'qq.com'), - ('2', '163.com'), - ('2', '126.com'), - ('2', '189.com'), - ('2', 'sohu.com'), - ('2', 'gmail.com'), - ('2', 'outlook.com'), - ('2', 'icloud.com'); - - --- ---------------------------- --- Table structure for user_subscribe --- ---------------------------- -CREATE TABLE `user_subscribe` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `code` CHAR(8) NOT NULL DEFAULT '' COMMENT '订阅地址唯一识别码', - `times` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '地址请求次数', - `status` BIT NOT NULL DEFAULT 1 COMMENT '状态:0-禁用、1-启用', - `ban_time` INT(10) UNSIGNED DEFAULT NULL COMMENT '封禁时间', - `ban_desc` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '封禁理由', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`), - INDEX `user_id` (`user_id`, `status`), - INDEX `code` (`code`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户订阅'; - - --- ---------------------------- --- Records of user_subscribe --- ---------------------------- -INSERT INTO `user_subscribe`(`id`, `user_id`, `code`, `created_at`, `updated_at`) -VALUES ('1', '1', 'SsXa1', Now(), Now()); - - --- ---------------------------- --- Table structure for user_subscribe_log --- ---------------------------- -CREATE TABLE `user_subscribe_log` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_subscribe_id` INT(10) UNSIGNED NOT NULL COMMENT '对应user_subscribe的id', - `request_ip` CHAR(45) DEFAULT NULL COMMENT '请求IP', - `request_time` DATETIME NOT NULL COMMENT '请求时间', - `request_header` TEXT COMMENT '请求头部信息', - PRIMARY KEY (`id`), - INDEX `user_subscribe_id` (`user_subscribe_id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户订阅访问日志'; - - --- ---------------------------- --- Table structure for user_daily_data_flow --- ---------------------------- -CREATE TABLE `user_daily_data_flow` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID,0表示统计全部节点', - `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', - `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', - `total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '总流量', - `traffic` VARCHAR(255) DEFAULT '' COMMENT '总流量(带单位)', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`), - INDEX `idx_user_node` (`user_id`, `node_id`) USING BTREE -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户每日流量统计'; - - --- ---------------------------- --- Table structure for user_hourly_data_flow --- ---------------------------- -CREATE TABLE `user_hourly_data_flow` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID,0表示统计全部节点', - `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', - `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', - `total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '总流量', - `traffic` VARCHAR(255) DEFAULT '' COMMENT '总流量(带单位)', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`), - INDEX `idx_user_node` (`user_id`, `node_id`) USING BTREE -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户每小时流量统计'; - - --- ---------------------------- --- Table structure for node_daily_data_flow --- ---------------------------- -CREATE TABLE `node_daily_data_flow` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', - `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', - `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', - `total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '总流量', - `traffic` VARCHAR(255) DEFAULT '' COMMENT '总流量(带单位)', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`), - INDEX `idx_node_id` (`node_id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点每日流量统计'; - - --- ---------------------------- --- Table structure for node_hourly_data_flow --- ---------------------------- -CREATE TABLE `node_hourly_data_flow` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', - `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', - `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', - `total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '总流量', - `traffic` VARCHAR(255) DEFAULT '' COMMENT '总流量(带单位)', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`), - INDEX `idx_node_id` (`node_id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点每小时流量统计'; - - --- ---------------------------- --- Table structure for user_baned_log --- ---------------------------- -CREATE TABLE `user_baned_log` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `time` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '封禁账号时长,单位分钟', - `description` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '操作描述', - `status` BIT NOT NULL DEFAULT 0 COMMENT '状态:0-未处理、1-已处理', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户封禁日志'; - - --- ---------------------------- --- Table structure for country --- ---------------------------- -CREATE TABLE `country` -( - `code` CHAR(2) NOT NULL COMMENT 'ISO国家代码', - `name` VARCHAR(10) NOT NULL COMMENT '名称', - PRIMARY KEY (`code`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='国家代码'; - - --- ---------------------------- --- Records of country --- ---------------------------- -INSERT INTO `country`(`code`, `name`) -VALUES ('au', '澳大利亚'), - ('br', '巴西'), - ('ca', '加拿大'), - ('ch', '瑞士'), - ('cn', '中国'), - ('de', '德国'), - ('dk', '丹麦'), - ('eg', '埃及'), - ('fr', '法国'), - ('gr', '希腊'), - ('hk', '香港'), - ('id', '印度尼西亚'), - ('ie', '爱尔兰'), - ('il', '以色列'), - ('in', '印度'), - ('iq', '伊拉克'), - ('ir', '伊朗'), - ('it', '意大利'), - ('jp', '日本'), - ('kr', '韩国'), - ('mx', '墨西哥'), - ('my', '马来西亚'), - ('nl', '荷兰'), - ('no', '挪威'), - ('nz', '纽西兰'), - ('ph', '菲律宾'), - ('ru', '俄罗斯'), - ('se', '瑞典'), - ('sg', '新加坡'), - ('th', '泰国'), - ('tr', '土耳其'), - ('tw', '台湾'), - ('uk', '英国'), - ('us', '美国'), - ('vn', '越南'), - ('pl', '波兰'), - ('kz', '哈萨克斯坦'), - ('ua', '乌克兰'), - ('ro', '罗马尼亚'), - ('ae', '阿联酋'), - ('za', '南非'), - ('mm', '缅甸'), - ('is', '冰岛'), - ('fi', '芬兰'), - ('lu', '卢森堡'), - ('be', '比利时'), - ('bg', '保加利亚'), - ('lt', '立陶宛'), - ('co', '哥伦比亚'), - ('mo', '澳门'), - ('ke', '肯尼亚'), - ('cz', '捷克'), - ('md', '摩尔多瓦'), - ('es', '西班牙'), - ('pk', '巴基斯坦'), - ('pt', '葡萄牙'), - ('hu', '匈牙利'), - ('ar', '阿根廷'); - - --- ---------------------------- --- Table structure for payment --- ---------------------------- -CREATE TABLE `payment` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `trade_no` VARCHAR(64) NOT NULL COMMENT '支付单号(本地订单号)', - `user_id` INT(10) UNSIGNED NOT NULL COMMENT '用户ID', - `order_id` INT(10) UNSIGNED NOT NULL COMMENT '本地订单ID', - `amount` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '金额,单位分', - `qr_code` TEXT COMMENT '支付二维码', - `url` TEXT COMMENT '支付链接', - `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '支付状态:-1-支付失败、0-等待支付、1-支付成功', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='支付单'; - - --- ---------------------------- --- Table structure for payment_callback --- ---------------------------- -CREATE TABLE `payment_callback` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `trade_no` VARCHAR(64) NOT NULL COMMENT '本地订单号', - `out_trade_no` VARCHAR(64) NOT NULL COMMENT '外部订单号(支付平台)', - `amount` INT(10) UNSIGNED NOT NULL COMMENT '交易金额,单位分', - `status` BIT NOT NULL COMMENT '交易状态:0-失败、1-成功', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='支付回调日志'; - - --- ---------------------------- --- Table structure for marketing --- ---------------------------- -CREATE TABLE `marketing` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` TINYINT(1) NOT NULL COMMENT '类型:1-邮件群发', - `receiver` TEXT NOT NULL COMMENT '接收者', - `title` VARCHAR(255) NOT NULL COMMENT '标题', - `content` TEXT NOT NULL COMMENT '内容', - `error` VARCHAR(255) NULL COMMENT '错误信息', - `status` TINYINT(1) NOT NULL COMMENT '状态:-1-失败、0-待发送、1-成功', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='营销'; - - --- ---------------------------- --- Table structure for user_login_log --- ---------------------------- -CREATE TABLE `user_login_log` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `ip` VARCHAR(45) NOT NULL COMMENT 'IP地址', - `country` VARCHAR(128) NOT NULL COMMENT '国家', - `province` VARCHAR(128) NOT NULL COMMENT '省份', - `city` VARCHAR(128) NOT NULL COMMENT '城市', - `county` VARCHAR(128) NOT NULL COMMENT '郡县', - `isp` VARCHAR(128) NOT NULL COMMENT '运营商', - `area` VARCHAR(255) NOT NULL COMMENT '地区', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户登录日志'; - - --- ---------------------------- --- Table structure for ss_node_ip --- ---------------------------- -CREATE TABLE `ss_node_ip` -( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `port` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '端口', - `type` CHAR(3) NOT NULL DEFAULT 'tcp' COMMENT '类型:all、tcp、udp', - `ip` TEXT COMMENT '连接IP:每个IP用,号隔开', - `created_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上报时间', - PRIMARY KEY (`id`), - KEY `idx_port` (`port`), - KEY `idx_node` (`node_id`), - KEY `idx_user` (`user_id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='用户连接IP'; - - --- ---------------------------- --- Table structure for rule --- ---------------------------- CREATE TABLE `rule` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-正则表达式、2-域名、3-IP、4-协议', - `name` VARCHAR(100) NOT NULL COMMENT '规则描述', - `pattern` TEXT NOT NULL COMMENT '规则值', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-正则表达式、2-域名、3-IP、4-协议', + `name` VARCHAR(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '规则描述', + `pattern` TEXT COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '规则值', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='审计规则'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; +INSERT INTO `rule` (`id`, `type`, `name`, `pattern`) +VALUES (1, 1, '360', '(.*.||)(^360|0360|1360|3600|360safe|^so|qhimg|qhmsg|^yunpan|qihoo|qhcdn|qhupdate|360totalsecurity|360shouji|qihucdn|360kan|secmp).(cn|com|net)'), + (2, 1, '腾讯管家', '(.guanjia.qq.com|qqpcmgr|QQPCMGR)'), + (3, 1, '金山毒霸', '(.*.||)(rising|kingsoft|duba|xindubawukong|jinshanduba).(com|net|org)'), + (4, 1, '暗网相关', '(.*.||)(netvigator|torproject).(cn|com|net|org)'), + (5, 1, '百度定位', '(api|ps|sv|offnavi|newvector|ulog.imap|newloc|tracknavi)(.map|).(baidu|n.shifen).com'), + (6, 1, '法轮功类', '(.*.||)(dafahao|minghui|dongtaiwang|dajiyuan|falundata|shenyun|tuidang|epochweekly|epochtimes|ntdtv|falundafa|wujieliulan|zhengjian).(org|com|net)'), + (7, 1, 'BT扩展名', '(torrent|.torrent|peer_id=|info_hash|get_peers|find_node|BitTorrent|announce_peer|announce.php?passkey=)'), + (8, 1, '邮件滥发', '((^.*@)(guerrillamail|guerrillamailblock|sharklasers|grr|pokemail|spam4|bccto|chacuo|027168).(info|biz|com|de|net|org|me|la)|Subject|HELO|SMTP)'), + (9, 1, '迅雷下载', '(.?)(xunlei|sandai|Thunder|XLLiveUD)(.)'), + (10, 1, '大陆应用', '(.*.||)(baidu|qq|163|189|10000|10010|10086|sohu|sogoucdn|sogou|uc|58|taobao|qpic|bilibili|hdslb|acgvideo|sina|douban|doubanio|xiaohongshu|sinaimg|weibo|xiaomi|youzanyun|meituan|dianping|biliapi|huawei|pinduoduo|cnzz).(org|com|net|cn)'), + (11, 1, '大陆银行', '(.*.||)(icbc|ccb|boc|bankcomm|abchina|cmbchina|psbc|cebbank|cmbc|pingan|spdb|citicbank|cib|hxb|bankofbeijing|hsbank|tccb|4001961200|bosc|hkbchina|njcb|nbcb|lj-bank|bjrcb|jsbchina|gzcb|cqcbank|czbank|hzbank|srcb|cbhb|cqrcb|grcbank|qdccb|bocd|hrbcb|jlbank|bankofdl|qlbchina|dongguanbank|cscb|hebbank|drcbank|zzbank|bsb|xmccb|hljrcc|jxnxs|gsrcu|fjnx|sxnxs|gx966888|gx966888|zj96596|hnnxs|ahrcu|shanxinj|hainanbank|scrcu|gdrcu|hbxh|ynrcc|lnrcc|nmgnxs|hebnx|jlnls|js96008|hnnx|sdnxs).(org|com|net|cn)'), + (12, 1, '台湾银行', '(.*.||)(firstbank|bot|cotabank|megabank|tcb-bank|landbank|hncb|bankchb|tbb|ktb|tcbbank|scsb|bop|sunnybank|kgibank|fubon|ctbcbank|cathaybk|eximbank|bok|ubot|feib|yuantabank|sinopac|esunbank|taishinbank|jihsunbank|entiebank|hwataibank|csc|skbank).(org|com|net|tw)'), + (13, 1, '大陆第三方支付', '(.*.||)(alipay|baifubao|yeepay|99bill|95516|51credit|cmpay|tenpay|lakala|jdpay).(org|com|net|cn)'), + (14, 1, '台湾特供', '(.*.||)(visa|mycard|mastercard|gov|gash|beanfun|bank|line).(org|com|net|cn|tw|jp|kr)'), + (15, 1, '涉政治类', '(.*.||)(shenzhoufilm|secretchina|renminbao|aboluowang|mhradio|guangming|zhengwunet|soundofhope|yuanming|zhuichaguoji|fgmtv|xinsheng|shenyunperformingarts|epochweekly|tuidang|shenyun|falundata|bannedbook|pincong|rfi|mingjingnews|boxun|rfa|scmp|ogate|voachinese).(org|com|net|rocks|fr)'), + (16, 1, '流媒体', '(.*.||)(youtube|googlevideo|hulu|netflix|nflxvideo|akamai|nflximg|hbo|mtv|bbc|tvb).(org|club|com|net|tv)'), + (17, 1, '测速类', '(.*.||)(fast|speedtest).(org|com|net|cn)'), + (18, 1, '外汇交易类', '(.*.||)(metatrader4|metatrader5|mql5).(org|com|net)'); --- ---------------------------- --- Records of rule --- ---------------------------- -INSERT INTO `rule`(`id`, `type`, `name`, `pattern`) -VALUES (1, '1', '360', - '(.*\.||)(^360|0360|1360|3600|360safe|^so|qhimg|qhmsg|^yunpan|qihoo|qhcdn|qhupdate|360totalsecurity|360shouji|qihucdn|360kan|secmp)\.(cn|com|net)'), - (2, '1', '腾讯管家', '(\.guanjia\.qq\.com|qqpcmgr|QQPCMGR)'), - (3, '1', '金山毒霸', '(.*\.||)(rising|kingsoft|duba|xindubawukong|jinshanduba)\.(com|net|org)'), - (4, '1', '暗网相关', '(.*\.||)(netvigator|torproject)\.(cn|com|net|org)'), - (5, '1', '百度定位', - '(api|ps|sv|offnavi|newvector|ulog\\.imap|newloc|tracknavi)(\\.map|)\\.(baidu|n\\.shifen)\\.com'), - (6, '1', '法轮功类', - '(.*\\.||)(dafahao|minghui|dongtaiwang|dajiyuan|falundata|shenyun|tuidang|epochweekly|epochtimes|ntdtv|falundafa|wujieliulan|zhengjian)\\.(org|com|net)'), - (7, '1', 'BT扩展名', - '(torrent|\\.torrent|peer_id=|info_hash|get_peers|find_node|BitTorrent|announce_peer|announce\\.php\\?passkey=)'), - (8, '1', '邮件滥发', - '((^.*\@)(guerrillamail|guerrillamailblock|sharklasers|grr|pokemail|spam4|bccto|chacuo|027168)\.(info|biz|com|de|net|org|me|la)|Subject|HELO|SMTP)'), - (9, '1', '迅雷下载', '(.?)(xunlei|sandai|Thunder|XLLiveUD)(.)'), - (10, '1', '大陆应用', - '(.*\\.||)(baidu|qq|163|189|10000|10010|10086|sohu|sogoucdn|sogou|uc|58|taobao|qpic|bilibili|hdslb|acgvideo|sina|douban|doubanio|xiaohongshu|sinaimg|weibo|xiaomi|youzanyun|meituan|dianping|biliapi|huawei|pinduoduo|cnzz)\\.(org|com|net|cn)'), - (11, '1', '大陆银行', - '(.*\\.||)(icbc|ccb|boc|bankcomm|abchina|cmbchina|psbc|cebbank|cmbc|pingan|spdb|citicbank|cib|hxb|bankofbeijing|hsbank|tccb|4001961200|bosc|hkbchina|njcb|nbcb|lj-bank|bjrcb|jsbchina|gzcb|cqcbank|czbank|hzbank|srcb|cbhb|cqrcb|grcbank|qdccb|bocd|hrbcb|jlbank|bankofdl|qlbchina|dongguanbank|cscb|hebbank|drcbank|zzbank|bsb|xmccb|hljrcc|jxnxs|gsrcu|fjnx|sxnxs|gx966888|gx966888|zj96596|hnnxs|ahrcu|shanxinj|hainanbank|scrcu|gdrcu|hbxh|ynrcc|lnrcc|nmgnxs|hebnx|jlnls|js96008|hnnx|sdnxs)\\.(org|com|net|cn)'), - (12, '1', '台湾银行', - '(.*\\.||)(firstbank|bot|cotabank|megabank|tcb-bank|landbank|hncb|bankchb|tbb|ktb|tcbbank|scsb|bop|sunnybank|kgibank|fubon|ctbcbank|cathaybk|eximbank|bok|ubot|feib|yuantabank|sinopac|esunbank|taishinbank|jihsunbank|entiebank|hwataibank|csc|skbank)\\.(org|com|net|tw)'), - (13, '1', '大陆第三方支付', - '(.*\\.||)(alipay|baifubao|yeepay|99bill|95516|51credit|cmpay|tenpay|lakala|jdpay)\\.(org|com|net|cn)'), - (14, '1', '台湾特供', '(.*\.||)(visa|mycard|mastercard|gov|gash|beanfun|bank|line)\.(org|com|net|cn|tw|jp|kr)'), - (15, '1', '涉政治类', - '(.*\\.||)(shenzhoufilm|secretchina|renminbao|aboluowang|mhradio|guangming|zhengwunet|soundofhope|yuanming|zhuichaguoji|fgmtv|xinsheng|shenyunperformingarts|epochweekly|tuidang|shenyun|falundata|bannedbook|pincong|rfi|mingjingnews|boxun|rfa|scmp|ogate|voachinese)\\.(org|com|net|rocks|fr)'), - (16, '1', '流媒体', - '(.*\.||)(youtube|googlevideo|hulu|netflix|nflxvideo|akamai|nflximg|hbo|mtv|bbc|tvb)\.(org|club|com|net|tv)'), - (17, '1', '测速类', '(.*\.||)(fast|speedtest)\.(org|com|net|cn)'), - (18, '1', '外汇交易类', '(.*\.||)(metatrader4|metatrader5|mql5)\.(org|com|net)'); - - --- ---------------------------- --- Table structure for rule_group --- ---------------------------- CREATE TABLE `rule_group` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `type` BIT NOT NULL DEFAULT 1 COMMENT '模式:1-阻断、0-放行', - `name` VARCHAR(255) NOT NULL COMMENT '分组名称', - `rules` JSON DEFAULT NULL COMMENT '关联的规则ID,多个用,号分隔', - `nodes` JSON DEFAULT NULL COMMENT '关联的节点ID,多个用,号分隔', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '模式:1-阻断、0-放行', + `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分组名称', + `rules` JSON DEFAULT NULL COMMENT '关联的规则ID,多个用,号分隔', + `nodes` JSON DEFAULT NULL COMMENT '关联的节点ID,多个用,号分隔', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='审计规则分组'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for rule_group_node --- ---------------------------- CREATE TABLE `rule_group_node` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, @@ -1333,118 +844,390 @@ CREATE TABLE `rule_group_node` `created_at` DATETIME NOT NULL COMMENT '创建时间', `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='审计规则分组节点关联表'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for rule_log --- ---------------------------- CREATE TABLE `rule_log` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', - `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', - `rule_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '规则ID,0表示白名单模式下访问访问了非规则允许的网址', - `reason` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '触发原因', + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', + `rule_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '规则ID,0表示白名单模式下访问访问了非规则允许的网址', + `reason` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '触发原因', `created_at` DATETIME NOT NULL COMMENT '创建时间', PRIMARY KEY (`id`), - INDEX `idx` (`user_id`, `node_id`, `rule_id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='触发审计规则日志表'; + KEY `idx` (`user_id`, `node_id`, `rule_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for node_rule --- ---------------------------- -CREATE TABLE `node_rule` +CREATE TABLE `ss_config` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NULL COMMENT '节点ID', - `rule_id` INT(10) UNSIGNED NULL COMMENT '审计规则ID', - `is_black` BIT NOT NULL DEFAULT 1 COMMENT '是否黑名单模式:0-不是、1-是', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` VARCHAR(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '配置名', + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型:1-加密方式、2-协议、3-混淆', + `is_default` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否默认:0-不是、1-是', + `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序:值越大排越前', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点审计规则关联'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; +INSERT INTO `ss_config` (`id`, `name`, `type`, `is_default`, `sort`) +VALUES (1, 'none', 1, 1, 0), + (2, 'rc4-md5', 1, 0, 0), + (3, 'aes-128-cfb', 1, 0, 0), + (4, 'aes-192-cfb', 1, 0, 0), + (5, 'aes-256-cfb', 1, 0, 0), + (6, 'aes-128-ctr', 1, 0, 0), + (7, 'aes-192-ctr', 1, 0, 0), + (8, 'aes-256-ctr', 1, 0, 0), + (9, 'aes-128-gcm', 1, 0, 0), + (10, 'aes-192-gcm', 1, 0, 0), + (11, 'aes-256-gcm', 1, 0, 0), + (12, 'bf-cfb', 1, 0, 0), + (13, 'cast5-cfb', 1, 0, 0), + (14, 'des-cfb', 1, 0, 0), + (15, 'salsa20', 1, 0, 0), + (16, 'chacha20', 1, 0, 0), + (17, 'chacha20-ietf', 1, 0, 0), + (18, 'chacha20-ietf-poly1305', 1, 0, 0), + (19, 'origin', 2, 1, 0), + (20, 'auth_sha1_v4', 2, 0, 0), + (21, 'auth_aes128_md5', 2, 0, 0), + (22, 'auth_aes128_sha1', 2, 0, 0), + (23, 'auth_chain_a', 2, 0, 0), + (24, 'auth_chain_b', 2, 0, 0), + (25, 'auth_chain_c', 2, 0, 0), + (26, 'auth_chain_d', 2, 0, 0), + (27, 'auth_chain_e', 2, 0, 0), + (28, 'auth_chain_f', 2, 0, 0), + (29, 'plain', 3, 1, 0), + (30, 'http_simple', 3, 0, 0), + (31, 'http_post', 3, 0, 0), + (32, 'tls1.2_ticket_auth', 3, 0, 0), + (33, 'tls1.2_ticket_fastauth', 3, 0, 0); --- ---------------------------- --- Table structure for `node_auth` --- ---------------------------- -CREATE TABLE `node_auth` +CREATE TABLE `ss_node` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `node_id` INT(10) UNSIGNED NOT NULL COMMENT '授权节点ID', - `key` CHAR(16) NOT NULL COMMENT '认证KEY', - `secret` CHAR(8) NOT NULL COMMENT '通信密钥', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '服务类型:1-Shadowsocks(R)、2-V2ray、3-Trojan、4-VNet', + `name` VARCHAR(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '名称', + `country_code` CHAR(5) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'un' COMMENT '国家代码', + `server` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '服务器域名地址', + `ip` VARCHAR(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '服务器IPV4地址', + `ipv6` VARCHAR(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '服务器IPV6地址', + `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '等级:0-无等级,全部可见', + `speed_limit` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点限速,为0表示不限速,单位Byte', + `client_limit` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '设备数限制', + `relay_server` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '中转地址', + `relay_port` SMALLINT(5) UNSIGNED DEFAULT NULL COMMENT '中转端口', + `description` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '节点简单描述', + `geo` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '节点地理位置', + `method` VARCHAR(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'aes-256-cfb' COMMENT '加密方式', + `protocol` VARCHAR(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'origin' COMMENT '协议', + `protocol_param` VARCHAR(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '协议参数', + `obfs` VARCHAR(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'plain' COMMENT '混淆', + `obfs_param` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '混淆参数', + `traffic_rate` DOUBLE(6, 2) UNSIGNED NOT NULL DEFAULT '1.00' COMMENT '流量比率', + `is_subscribe` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '是否允许用户订阅该节点:0-否、1-是', + `is_ddns` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否使用DDNS:0-否、1-是', + `is_relay` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否中转节点:0-否、1-是', + `is_udp` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '是否启用UDP:0-不启用、1-启用', + `push_port` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '1000' COMMENT '消息推送端口', + `detection_type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '节点检测: 0-关闭、1-只检测TCP、2-只检测ICMP、3-检测全部', + `compatible` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '兼容SS', + `single` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '启用单端口功能:0-否、1-是', + `port` SMALLINT(5) UNSIGNED DEFAULT NULL COMMENT '单端口的端口号或连接端口号', + `passwd` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '单端口的连接密码', + `sort` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '排序值,值越大越靠前显示', + `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态:0-维护、1-正常', + `v2_alter_id` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '16' COMMENT 'V2Ray额外ID', + `v2_port` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'V2Ray服务端口', + `v2_method` VARCHAR(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'aes-128-gcm' COMMENT 'V2Ray加密方式', + `v2_net` VARCHAR(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'tcp' COMMENT 'V2Ray传输协议', + `v2_type` VARCHAR(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'none' COMMENT 'V2Ray伪装类型', + `v2_host` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'V2Ray伪装的域名', + `v2_path` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'V2Ray的WS/H2路径', + `v2_tls` TINYINT(1) NOT NULL DEFAULT '0' COMMENT 'V2Ray连接TLS:0-未开启、1-开启', + `tls_provider` TEXT COLLATE utf8mb4_unicode_ci COMMENT 'V2Ray节点的TLS提供商授权信息', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`), - INDEX `id` (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='节点授权密钥表'; + KEY `ss_node_is_subscribe_index` (`is_subscribe`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for `node_certificate` --- ---------------------------- -CREATE TABLE `node_certificate` +CREATE TABLE `ss_node_info` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `domain` VARCHAR(255) NOT NULL COMMENT '域名', - `key` TEXT NULL COMMENT '域名证书KEY', - `pem` TEXT NULL COMMENT '域名证书PEM', - `created_at` DATETIME NOT NULL COMMENT '创建时间', - `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', - PRIMARY KEY (`id`) USING BTREE -) ENGINE = InnoDB COLLATE = 'utf8mb4_unicode_ci' COMMENT ='域名证书'; - - --- ---------------------------- --- Table structure for failed_jobs --- ---------------------------- -CREATE TABLE `failed_jobs` -( - `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `connection` TEXT NOT NULL, - `queue` TEXT NOT NULL, - `payload` LONGTEXT NOT NULL, - `exception` LONGTEXT NOT NULL, - `failed_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='失败任务'; - - --- ---------------------------- --- Table structure for jobs --- ---------------------------- -CREATE TABLE `jobs` -( - `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, - `queue` VARCHAR(255) NOT NULL, - `payload` LONGTEXT NOT NULL, - `attempts` TINYINT(3) UNSIGNED NOT NULL, - `reserved_at` INT(10) UNSIGNED DEFAULT NULL, - `available_at` INT(10) UNSIGNED NOT NULL, - `created_at` INT(10) UNSIGNED NOT NULL, + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', + `uptime` INT(10) UNSIGNED NOT NULL COMMENT '后端存活时长,单位秒', + `load` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '负载', + `log_time` INT(10) UNSIGNED NOT NULL COMMENT '记录时间', PRIMARY KEY (`id`), - KEY `jobs_queue_index` (`queue`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='任务'; + KEY `ss_node_info_node_id_index` (`node_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; --- ---------------------------- --- Table structure for migrations --- ---------------------------- -CREATE TABLE `migrations` +CREATE TABLE `ss_node_ip` ( - `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, - `migration` VARCHAR(255) NOT NULL, - `batch` INT(10) UNSIGNED NOT NULL, + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `port` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '端口', + `type` CHAR(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'tcp' COMMENT '类型:all、tcp、udp', + `ip` TEXT COLLATE utf8mb4_unicode_ci COMMENT '连接IP:每个IP用,号隔开', + `created_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上报时间', + PRIMARY KEY (`id`), + KEY `ss_node_ip_node_id_index` (`node_id`), + KEY `ss_node_ip_user_id_index` (`user_id`), + KEY `ss_node_ip_port_index` (`port`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `ss_node_online_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `node_id` INT(10) UNSIGNED NOT NULL COMMENT '节点ID', + `online_user` INT(10) UNSIGNED NOT NULL COMMENT '在线用户数', + `log_time` INT(10) UNSIGNED NOT NULL COMMENT '记录时间', + PRIMARY KEY (`id`), + KEY `ss_node_online_log_node_id_index` (`node_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `ticket` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `admin_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理员ID', + `title` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '标题', + `content` TEXT COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '内容', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-待处理、1-已处理未关闭、2-已关闭', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', PRIMARY KEY (`id`) -) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT ='迁移'; +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; -/*!40111 SET SQL_NOTES = @old_sql_notes */; -/*!40101 SET SQL_MODE = @old_sql_mode */; -/*!40014 SET FOREIGN_KEY_CHECKS = @old_foreign_key_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 */; \ No newline at end of file +CREATE TABLE `ticket_reply` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `ticket_id` INT(10) UNSIGNED NOT NULL COMMENT '工单ID', + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '回复用户ID', + `admin_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理员ID', + `content` TEXT COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '回复内容', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `username` VARCHAR(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '昵称', + `email` VARCHAR(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱', + `password` VARCHAR(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码', + `port` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '代理端口', + `passwd` VARCHAR(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '代理密码', + `vmess_id` CHAR(36) COLLATE utf8mb4_unicode_ci NOT NULL, + `transfer_enable` BIGINT(20) UNSIGNED NOT NULL DEFAULT '1099511627776' COMMENT '可用流量,单位字节,默认1TiB', + `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '已上传流量,单位字节', + `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '已下载流量,单位字节', + `t` INT(10) UNSIGNED DEFAULT NULL COMMENT '最后使用时间', + `ip` VARCHAR(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '最后连接IP', + `enable` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '代理状态', + `method` VARCHAR(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'aes-256-cfb' COMMENT '加密方式', + `protocol` VARCHAR(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'origin' COMMENT '协议', + `protocol_param` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '协议参数', + `obfs` VARCHAR(30) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'plain' COMMENT '混淆', + `speed_limit` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户限速,为0表示不限速,单位Byte', + `wechat` VARCHAR(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '微信', + `qq` VARCHAR(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'QQ', + `credit` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '余额,单位分', + `expired_at` DATE NOT NULL DEFAULT '2099-01-01' COMMENT '过期时间', + `ban_time` INT(10) UNSIGNED DEFAULT NULL COMMENT '封禁到期时间', + `remark` TEXT COLLATE utf8mb4_unicode_ci COMMENT '备注', + `level` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '等级,默认0级', + `group_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '所属分组', + `is_admin` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '是否管理员:0-否、1-是', + `reg_ip` VARCHAR(45) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '127.0.0.1' COMMENT '注册IP', + `last_login` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '最后登录时间', + `inviter_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '邀请人', + `reset_time` DATE DEFAULT NULL COMMENT '流量重置日期', + `invite_num` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '可生成邀请码数', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:-1-禁用、0-未激活、1-正常', + `remember_token` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `user_email_unique` (`email`), + KEY `idx_search` (`enable`, `status`, `port`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + +INSERT INTO `user` (`id`, `username`, `email`, `password`, `port`, `passwd`, `vmess_id`, `transfer_enable`, `u`, `d`, `t`, `ip`, `enable`, `method`, `protocol`, `protocol_param`, `obfs`, `speed_limit`, `wechat`, `qq`, `credit`, `expired_at`, `ban_time`, `remark`, `level`, `group_id`, `is_admin`, `reg_ip`, `last_login`, `inviter_id`, `reset_time`, `invite_num`, `status`, `remember_token`, `created_at`, `updated_at`) +VALUES (1, '管理员', 'test@test.com', '$2y$10$vDaFh91Fn5vjdG1M5grp6OHwKNf7jEGo47794.5GTC7H5sEvNah6e', 10000, '32uNUkMfikhi5twv', '0a9f2656-395b-4ecf-8134-c8462d245156', 1099511627776, 0, 0, NULL, NULL, 1, 'aes-256-cfb', 'origin', NULL, 'plain', 0, NULL, NULL, 0, '2099-01-01', NULL, NULL, 0, 0, 0, '127.0.0.1', 0, NULL, NULL, 0, 0, NULL, '2020-08-25 13:09:16', '2020-08-25 13:09:16'); + +CREATE TABLE `user_baned_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL COMMENT '用户ID', + `time` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '封禁账号时长,单位分钟', + `description` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '操作描述', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-未处理、1-已处理', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user_credit_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '账号ID', + `order_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单ID', + `before` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发生前余额,单位分', + `after` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发生后金额,单位分', + `amount` INT(11) NOT NULL DEFAULT '0' COMMENT '发生金额,单位分', + `description` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '操作描述', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user_daily_data_flow` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID,0表示统计全部节点', + `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', + `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', + `total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '总流量', + `traffic` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '总流量(带单位)', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `idx_user_node` (`user_id`, `node_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user_data_modify_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `order_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '发生的订单ID', + `before` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '操作前流量', + `after` BIGINT(20) NOT NULL DEFAULT '0' COMMENT '操作后流量', + `description` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '描述', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user_group` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `name` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分组名称', + `nodes` JSON DEFAULT NULL COMMENT '关联的节点ID,多个用,号分隔', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user_hourly_data_flow` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL COMMENT '用户ID', + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID,0表示统计全部节点', + `u` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', + `d` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', + `total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '总流量', + `traffic` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '总流量(带单位)', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`), + KEY `idx_user_node` (`user_id`, `node_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user_login_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `ip` VARCHAR(45) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'IP地址', + `country` VARCHAR(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '国家', + `province` VARCHAR(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '省份', + `city` VARCHAR(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '城市', + `county` VARCHAR(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '郡县', + `isp` VARCHAR(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '运营商', + `area` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '地区', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user_subscribe` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `code` CHAR(8) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '订阅地址唯一识别码', + `times` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '地址请求次数', + `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态:0-禁用、1-启用', + `ban_time` INT(10) UNSIGNED DEFAULT NULL COMMENT '封禁时间', + `ban_desc` VARCHAR(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封禁理由', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`), + KEY `user_id` (`user_id`, `status`), + KEY `user_subscribe_code_index` (`code`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + +INSERT INTO `user_subscribe` (`id`, `user_id`, `code`, `times`, `status`, `ban_time`, `ban_desc`, `created_at`, `updated_at`) +VALUES (1, 1, 'SVgMC2Wx', 0, 1, NULL, NULL, '2020-08-25 13:09:16', '2020-08-25 13:09:16'); + +CREATE TABLE `user_subscribe_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_subscribe_id` INT(10) UNSIGNED NOT NULL COMMENT '对应user_subscribe的id', + `request_ip` VARCHAR(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '请求IP', + `request_time` DATETIME NOT NULL COMMENT '请求时间', + `request_header` TEXT COLLATE utf8mb4_unicode_ci COMMENT '请求头部信息', + PRIMARY KEY (`id`), + KEY `user_subscribe_log_user_subscribe_id_index` (`user_subscribe_id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `user_traffic_log` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID', + `node_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '节点ID', + `u` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上传流量', + `d` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下载流量', + `rate` DOUBLE(6, 2) UNSIGNED NOT NULL COMMENT '倍率', + `traffic` VARCHAR(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '产生流量', + `log_time` INT(10) UNSIGNED NOT NULL COMMENT '记录时间', + PRIMARY KEY (`id`), + KEY `idx_user_node_time` (`user_id`, `node_id`, `log_time`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `verify` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '激活类型:1-自行激活、2-管理员激活', + `user_id` INT(10) UNSIGNED NOT NULL COMMENT '用户ID', + `token` VARCHAR(32) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '校验token', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-未使用、1-已使用、2-已失效', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; + + +CREATE TABLE `verify_code` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `address` VARCHAR(128) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户邮箱', + `code` CHAR(6) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '验证码', + `status` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '状态:0-未使用、1-已使用、2-已失效', + `created_at` DATETIME NOT NULL COMMENT '创建时间', + `updated_at` DATETIME NOT NULL COMMENT '最后更新时间', + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; \ No newline at end of file diff --git a/sql/mod/20200823.sql b/sql/mod/20200823.sql new file mode 100644 index 00000000..9120c4e5 --- /dev/null +++ b/sql/mod/20200823.sql @@ -0,0 +1,92 @@ +ALTER TABLE `coupon` + CHANGE `logo` `logo` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '优惠券LOGO'; + +ALTER TABLE `coupon_log` + CHANGE `description` `description` VARCHAR(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注'; + +ALTER TABLE `goods` + CHANGE `renew` `renew` INT(10) UNSIGNED DEFAULT NULL COMMENT '流量重置价格,单位分', + CHANGE `period` `period` INT(10) UNSIGNED DEFAULT NULL COMMENT '流量自动重置周期', + CHANGE `invite_num` `invite_num` INT(10) UNSIGNED DEFAULT NULL COMMENT '赠送邀请码数', + CHANGE `limit_num` `limit_num` INT(10) UNSIGNED DEFAULT NULL COMMENT '限购数量,默认为null不限购'; + +ALTER TABLE `invite` + CHANGE `code` `code` CHAR(12) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邀请码'; + +ALTER TABLE `order` + CHANGE `goods_id` `goods_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '商品ID', + CHANGE `coupon_id` `coupon_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '优惠券ID'; + +ALTER TABLE `rule_log` + CHANGE `reason` `reason` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '触发原因'; + +ALTER TABLE `ss_node` + CHANGE `v2_host` `v2_host` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'V2Ray伪装的域名', + CHANGE `v2_path` `v2_path` VARCHAR(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'V2Ray的WS/H2路径'; + +ALTER TABLE `user_credit_log` + CHANGE `order_id` `order_id` INT(10) UNSIGNED DEFAULT NULL COMMENT '订单ID'; + +DROP TABLE IF EXISTS `migrations`; + +CREATE TABLE `migrations` +( + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, + `migration` VARCHAR(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `batch` INT(11) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; +INSERT INTO `migrations` (`id`, `migration`, `batch`) + +VALUES (1, '2020_08_21_145711_create_article_table', 1), + (2, '2020_08_21_145711_create_config_table', 1), + (3, '2020_08_21_145711_create_country_table', 1), + (4, '2020_08_21_145711_create_coupon_log_table', 1), + (5, '2020_08_21_145711_create_coupon_table', 1), + (6, '2020_08_21_145711_create_email_filter_table', 1), + (7, '2020_08_21_145711_create_failed_jobs_table', 1), + (8, '2020_08_21_145711_create_goods_table', 1), + (9, '2020_08_21_145711_create_invite_table', 1), + (10, '2020_08_21_145711_create_jobs_table', 1), + (11, '2020_08_21_145711_create_label_table', 1), + (12, '2020_08_21_145711_create_level_table', 1), + (13, '2020_08_21_145711_create_marketing_table', 1), + (14, '2020_08_21_145711_create_node_auth_table', 1), + (15, '2020_08_21_145711_create_node_certificate_table', 1), + (16, '2020_08_21_145711_create_node_daily_data_flow_table', 1), + (17, '2020_08_21_145711_create_node_hourly_data_flow_table', 1), + (18, '2020_08_21_145711_create_node_label_table', 1), + (19, '2020_08_21_145711_create_node_ping_table', 1), + (20, '2020_08_21_145711_create_node_rule_table', 1), + (21, '2020_08_21_145711_create_notification_log_table', 1), + (22, '2020_08_21_145711_create_order_table', 1), + (23, '2020_08_21_145711_create_payment_callback_table', 1), + (24, '2020_08_21_145711_create_payment_table', 1), + (25, '2020_08_21_145711_create_products_pool_table', 1), + (26, '2020_08_21_145711_create_referral_apply_table', 1), + (27, '2020_08_21_145711_create_referral_log_table', 1), + (28, '2020_08_21_145711_create_rule_group_node_table', 1), + (29, '2020_08_21_145711_create_rule_group_table', 1), + (30, '2020_08_21_145711_create_rule_log_table', 1), + (31, '2020_08_21_145711_create_rule_table', 1), + (32, '2020_08_21_145711_create_ss_config_table', 1), + (33, '2020_08_21_145711_create_ss_node_info_table', 1), + (34, '2020_08_21_145711_create_ss_node_ip_table', 1), + (35, '2020_08_21_145711_create_ss_node_online_log_table', 1), + (36, '2020_08_21_145711_create_ss_node_table', 1), + (37, '2020_08_21_145711_create_ticket_reply_table', 1), + (38, '2020_08_21_145711_create_ticket_table', 1), + (39, '2020_08_21_145711_create_user_baned_log_table', 1), + (40, '2020_08_21_145711_create_user_credit_log_table', 1), + (41, '2020_08_21_145711_create_user_daily_data_flow_table', 1), + (42, '2020_08_21_145711_create_user_data_modify_log_table', 1), + (43, '2020_08_21_145711_create_user_group_table', 1), + (44, '2020_08_21_145711_create_user_hourly_data_flow_table', 1), + (45, '2020_08_21_145711_create_user_login_log_table', 1), + (46, '2020_08_21_145711_create_user_subscribe_log_table', 1), + (47, '2020_08_21_145711_create_user_subscribe_table', 1), + (48, '2020_08_21_145711_create_user_table', 1), + (49, '2020_08_21_145711_create_user_traffic_log_table', 1), + (50, '2020_08_21_145711_create_verify_code_table', 1), + (51, '2020_08_21_145711_create_verify_table', 1), + (52, '2020_08_21_150711_preset_data', 1);