فهرست منبع

1.修正注册bug
2.修正繁体语言包错误
3.优化迁移文件

bingo 7 سال پیش
والد
کامیت
bb7dd895ef
46فایلهای تغییر یافته به همراه369 افزوده شده و 98 حذف شده
  1. 2 2
      app/Console/Commands/AutoRemoveDisabledUserLabelsJob.php
  2. 2 2
      app/Http/Controllers/AdminController.php
  3. 1 1
      app/Http/Controllers/Api/LoginController.php
  4. 14 14
      app/Http/Controllers/RegisterController.php
  5. 1 1
      app/Http/Models/SsConfig.php
  6. 4 2
      database/migrations/2017_12_29_134159_create_article_table.php
  7. 3 1
      database/migrations/2017_12_29_135722_create_config_table.php
  8. 3 1
      database/migrations/2017_12_29_135738_create_country_table.php
  9. 2 0
      database/migrations/2017_12_29_135751_create_coupon_table.php
  10. 2 0
      database/migrations/2017_12_29_135804_create_coupon_log_table.php
  11. 2 0
      database/migrations/2017_12_29_135816_create_email_log_table.php
  12. 2 0
      database/migrations/2017_12_29_135828_create_goods_table.php
  13. 2 0
      database/migrations/2017_12_29_135839_create_invite_table.php
  14. 2 0
      database/migrations/2017_12_29_135850_create_level_table.php
  15. 5 3
      database/migrations/2017_12_29_135900_create_order_table.php
  16. 3 1
      database/migrations/2017_12_29_135915_create_order_goods_table.php
  17. 2 0
      database/migrations/2017_12_29_135948_create_referral_apply_table.php
  18. 2 0
      database/migrations/2017_12_29_140008_create_referral_log_table.php
  19. 2 2
      database/migrations/2017_12_29_140026_create_ss_config_table.php
  20. 3 1
      database/migrations/2017_12_29_140038_create_ss_group_table.php
  21. 2 0
      database/migrations/2017_12_29_140049_create_ss_group_node_table.php
  22. 6 2
      database/migrations/2017_12_29_140101_create_ss_node_table.php
  23. 2 0
      database/migrations/2017_12_29_140111_create_ss_node_info_table.php
  24. 2 0
      database/migrations/2017_12_29_140125_create_ss_node_online_log_table.php
  25. 2 0
      database/migrations/2017_12_29_140140_create_ss_node_traffic_daily_table.php
  26. 2 0
      database/migrations/2017_12_29_140153_create_ss_node_traffic_hourly_table.php
  27. 2 0
      database/migrations/2017_12_29_140205_create_ticket_table.php
  28. 2 0
      database/migrations/2017_12_29_140216_create_ticket_reply_table.php
  29. 2 2
      database/migrations/2017_12_29_140229_create_user_table.php
  30. 2 0
      database/migrations/2017_12_29_140239_create_user_balance_log_table.php
  31. 2 0
      database/migrations/2017_12_29_140253_create_user_ban_log_table.php
  32. 2 0
      database/migrations/2017_12_29_140304_create_user_score_log_table.php
  33. 2 0
      database/migrations/2017_12_29_140319_create_user_subscribe_table.php
  34. 2 0
      database/migrations/2017_12_29_140330_create_user_subscribe_log_table.php
  35. 2 0
      database/migrations/2017_12_29_140345_create_user_traffic_daily_table.php
  36. 2 0
      database/migrations/2017_12_29_140357_create_user_traffic_hourly_table.php
  37. 2 0
      database/migrations/2017_12_29_140409_create_user_traffic_log_table.php
  38. 2 0
      database/migrations/2017_12_29_140422_create_verify_table.php
  39. 39 0
      database/migrations/2018_05_24_113606_create_goods_label_table.php
  40. 47 0
      database/migrations/2018_05_24_113645_create_payment_table.php
  41. 48 0
      database/migrations/2018_05_24_113657_create_payment_callback_table.php
  42. 36 0
      database/migrations/2018_05_24_113825_create_label_table.php
  43. 36 0
      database/migrations/2018_05_24_113851_create_user_label_table.php
  44. 1 1
      resources/lang/zh-CN/home.php
  45. 5 5
      resources/lang/zh-tw/home.php
  46. 58 57
      sql/db.sql

+ 2 - 2
app/Console/Commands/AutoRemoveDisabledUserLabelsJob.php

@@ -19,10 +19,10 @@ class AutoRemoveDisabledUserLabelsJob extends Command
 
     public function handle()
     {
-        $userList = User::query()->where('enable', 0)->get();
+        // 账号被禁用,则删除所有标签
+        $userList = User::query()->where('enable', 0)->where('ban_time', 0)->get();
         if (!$userList->isEmpty()) {
             foreach ($userList as $user) {
-                // 账号被禁用,则删除所有标签
                 UserLabel::query()->where('user_id', $user->id)->delete();
             }
         }

+ 2 - 2
app/Http/Controllers/AdminController.php

@@ -1366,12 +1366,12 @@ class AdminController extends Controller
         }
 
         $config = SsConfig::query()->where('id', $id)->first();
-        if (empty($config)) {
+        if (!$config) {
             return Response::json(['status' => 'fail', 'data' => '', 'message' => '配置不存在']);
         }
 
         // 去除该配置所属类型的默认值
-        SsConfig::query()->where('type', $config->type)->update(['is_default' => 0]);
+        SsConfig::query()->where('type', $config->type)->where('is_default', 1)->update(['is_default' => 0]);
 
         // 将该ID对应记录值置为默认值
         SsConfig::query()->where('id', $id)->update(['is_default' => 1]);

+ 1 - 1
app/Http/Controllers/Api/LoginController.php

@@ -68,7 +68,7 @@ class LoginController extends Controller
         }
 
         // 用户信息
-        unset($user->password, $user->custom_method, $user->remember_token);
+        unset($user->password, $user->remember_token);
         $data['user'] = $user;
 
         // 订阅链接

+ 14 - 14
app/Http/Controllers/RegisterController.php

@@ -163,29 +163,29 @@ class RegisterController extends Controller
             $user->referral_uid = $referral_uid;
             $user->save();
 
-            // 注册次数+1
             if ($user->id) {
+                // 注册次数+1
                 if (Cache::has($cacheKey)) {
                     Cache::increment($cacheKey);
                 } else {
                     Cache::put($cacheKey, 1, 1440); // 24小时
                 }
-            }
 
-            // 初始化默认标签
-            if (count(self::$config['initial_labels_for_user']) > 0 && $user->id) {
-                $labels = explode(',', self::$config['initial_labels_for_user']);
-                foreach ($labels as $label) {
-                    $userLabel = new UserLabel();
-                    $userLabel->user_id = $user->id;
-                    $userLabel->label_id = $label;
-                    $userLabel->save();
+                // 初始化默认标签
+                if (strlen(self::$config['initial_labels_for_user'])) {
+                    $labels = explode(',', self::$config['initial_labels_for_user']);
+                    foreach ($labels as $label) {
+                        $userLabel = new UserLabel();
+                        $userLabel->user_id = $user->id;
+                        $userLabel->label_id = $label;
+                        $userLabel->save();
+                    }
                 }
-            }
 
-            // 更新邀请码
-            if (self::$config['is_invite_register'] && $user->id) {
-                Invite::query()->where('id', $code->id)->update(['fuid' => $user->id, 'status' => 1]);
+                // 更新邀请码
+                if (self::$config['is_invite_register']) {
+                    Invite::query()->where('id', $code->id)->update(['fuid' => $user->id, 'status' => 1]);
+                }
             }
 
             // 发送邮件

+ 1 - 1
app/Http/Models/SsConfig.php

@@ -14,5 +14,5 @@ class SsConfig extends Model
 {
     protected $table = 'ss_config';
     protected $primaryKey = 'id';
-
+    public $timestamps = false;
 }

+ 4 - 2
database/migrations/2017_12_29_134159_create_article_table.php

@@ -15,13 +15,15 @@ class CreateArticleTable extends Migration
     {
         Schema::create('article', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('title', 100)->default('')->comment('标题');
             $table->string('author', 50)->default('')->comment('作者');
-            $table->text('content')->comment('内容')->nullable();
-            $table->tinyInteger('is_del')->default('0')->comment('是否删除');
+            $table->text('content')->nullable()->comment('内容');
             $table->tinyInteger('type')->default('1')->comment('类型:1-文章、2-公告');
+            $table->tinyInteger('is_del')->default('0')->comment('是否删除');
             $table->integer('sort')->default('0')->comment('排序');
             $table->dateTime('created_at')->nullable();
             $table->dateTime('updated_at')->nullable();

+ 3 - 1
database/migrations/2017_12_29_135722_create_config_table.php

@@ -15,10 +15,12 @@ class CreateConfigTable extends Migration
     {
         Schema::create('config', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('name', 255)->default('')->comment('配置名');
-            $table->string('value', 255)->default('')->comment('配置值');
+            $table->text('value')->nullable()->comment('配置值');
         });
     }
 

+ 3 - 1
database/migrations/2017_12_29_135738_create_country_table.php

@@ -14,7 +14,9 @@ class CreateCountryTable extends Migration
     public function up()
     {
         Schema::create('country', function (Blueprint $table) {
-            $table->engine = 'MyISAM';
+            $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('country_name', 50)->default('')->comment('名称');

+ 2 - 0
database/migrations/2017_12_29_135751_create_coupon_table.php

@@ -15,6 +15,8 @@ class CreateCouponTable extends Migration
     {
         Schema::create('coupon', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('name', 50)->default('')->comment('优惠券名称');

+ 2 - 0
database/migrations/2017_12_29_135804_create_coupon_log_table.php

@@ -15,6 +15,8 @@ class CreateCouponLogTable extends Migration
     {
         Schema::create('coupon_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('coupon_id')->default('0')->comment('优惠券ID');

+ 2 - 0
database/migrations/2017_12_29_135816_create_email_log_table.php

@@ -15,6 +15,8 @@ class CreateEmailLogTable extends Migration
     {
         Schema::create('email_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('接收者ID');

+ 2 - 0
database/migrations/2017_12_29_135828_create_goods_table.php

@@ -15,6 +15,8 @@ class CreateGoodsTable extends Migration
     {
         Schema::create('goods', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('sku', 15)->default('')->comment('商品服务SKU');

+ 2 - 0
database/migrations/2017_12_29_135839_create_invite_table.php

@@ -15,6 +15,8 @@ class CreateInviteTable extends Migration
     {
         Schema::create('invite', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('uid')->default('0')->comment('邀请人ID');

+ 2 - 0
database/migrations/2017_12_29_135850_create_level_table.php

@@ -15,6 +15,8 @@ class CreateLevelTable extends Migration
     {
         Schema::create('level', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('level')->default('1')->comment('等级');

+ 5 - 3
database/migrations/2017_12_29_135900_create_order_table.php

@@ -15,17 +15,19 @@ class CreateOrderTable extends Migration
     {
         Schema::create('order', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('oid');
-            $table->string('orderId', 20)->default('')->comment('订单编号');
+            $table->string('order_sn', 20)->default('')->comment('订单编号');
             $table->integer('user_id')->default('0')->comment('操作人');
             $table->integer('goods_id')->default('0')->comment('商品ID');
             $table->integer('coupon_id')->default('0')->comment('优惠券ID');
-            $table->integer('orgin_amount')->default('0')->comment('订单原始总价,单位分');
+            $table->integer('origin_amount')->default('0')->comment('订单原始总价,单位分');
             $table->integer('amount')->default('0')->comment('订单总价,单位分');
             $table->dateTime('expire_at')->nullable()->comment('过期时间');
             $table->tinyInteger('is_expire')->default('0')->comment('是否已过期:0-未过期、1-已过期');
-            $table->tinyInteger('pay_way')->default('1')->comment('支付方式:1-余额支付、2-PayPal');
+            $table->tinyInteger('pay_way')->default('1')->comment('支付方式:1-余额支付、2-有赞云支付');
             $table->tinyInteger('status')->default('0')->comment('订单状态:-1-已关闭、0-待支付、1-已支付待确认、2-已完成');
             $table->dateTime('created_at')->nullable();
             $table->dateTime('updated_at')->nullable();

+ 3 - 1
database/migrations/2017_12_29_135915_create_order_goods_table.php

@@ -15,10 +15,12 @@ class CreateOrderGoodsTable extends Migration
     {
         Schema::create('order_goods', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('oid')->default('0')->comment('订单ID');
-            $table->string('orderId', 20)->default('')->comment('订单编号');
+            $table->string('order_sn', 20)->default('')->comment('订单编号');
             $table->integer('user_id')->default('0')->comment('用户ID');
             $table->integer('goods_id')->default('0')->comment('商品ID');
             $table->integer('num')->default('0')->comment('商品数量');

+ 2 - 0
database/migrations/2017_12_29_135948_create_referral_apply_table.php

@@ -15,6 +15,8 @@ class CreateReferralApplyTable extends Migration
     {
         Schema::create('referral_apply', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140008_create_referral_log_table.php

@@ -15,6 +15,8 @@ class CreateReferralLogTable extends Migration
     {
         Schema::create('referral_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 2
database/migrations/2017_12_29_140026_create_ss_config_table.php

@@ -15,14 +15,14 @@ class CreateSsConfigTable extends Migration
     {
         Schema::create('ss_config', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('name', 50)->default('')->comment('配置名');
             $table->tinyInteger('type')->default('1')->comment('类型:1-加密方式、2-协议、3-混淆');
             $table->tinyInteger('is_default')->default('0')->comment('是否默认:0-不是、1-是');
             $table->integer('sort')->default('0')->comment('排序:值越大排越前');
-            $table->dateTime('created_at')->nullable();
-            $table->dateTime('updated_at')->nullable();
         });
     }
 

+ 3 - 1
database/migrations/2017_12_29_140038_create_ss_group_table.php

@@ -15,10 +15,12 @@ class CreateSsGroupTable extends Migration
     {
         Schema::create('ss_group', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('name', 50)->default('')->comment('分组名称');
-            $table->tinyInteger('level')->default('1')->comment('分组级别,对应账号级别');
+            $table->tinyInteger('level')->default('1')->comment('分组级别');
             $table->dateTime('created_at')->nullable();
             $table->dateTime('updated_at')->nullable();
         });

+ 2 - 0
database/migrations/2017_12_29_140049_create_ss_group_node_table.php

@@ -15,6 +15,8 @@ class CreateSsGroupNodeTable extends Migration
     {
         Schema::create('ss_group_node', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('group_id')->default('0')->comment('分组ID');

+ 6 - 2
database/migrations/2017_12_29_140101_create_ss_node_table.php

@@ -15,15 +15,18 @@ class CreateSsNodeTable extends Migration
     {
         Schema::create('ss_node', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('name', 128)->default('')->comment('名称');
             $table->integer('group_id')->default('0')->comment('所属分组');
             $table->char('country_code', 5)->default('')->nullable()->comment('国家代码');
             $table->string('server', 128)->default('')->nullable()->comment('服务器域名地址');
-            $table->string('ip', 30)->default('')->nullable()->comment('服务器IP地址');
+            $table->string('ip', 15)->default('')->nullable()->comment('服务器IPV4地址');
+            $table->string('ipv6', 128)->default('')->nullable()->comment('服务器IPV6地址');
             $table->string('desc', 255)->default('')->nullable()->comment('节点简单描述');
-            $table->string('method', 30)->default('aes-192-ctr')->comment('加密方式');
+            $table->string('method', 32)->default('aes-192-ctr')->comment('加密方式');
             $table->string('protocol', 128)->default('auth_chain_a')->comment('协议');
             $table->string('protocol_param', 128)->default('')->nullable()->comment('协议参数');
             $table->string('obfs', 128)->default('tls1.2_ticket_auth')->comment('混淆');
@@ -32,6 +35,7 @@ class CreateSsNodeTable extends Migration
             $table->integer('bandwidth')->default('100')->comment('出口带宽,单位M');
             $table->bigInteger('traffic')->default('1000')->comment('每月可用流量,单位G');
             $table->string('monitor_url', 255)->default('')->nullable()->comment('监控地址');
+            $table->tinyInteger('is_subscribe')->default('1')->nullable()->comment('是否允许用户订阅该节点:0-否、1-是');
             $table->tinyInteger('compatible')->default('0')->nullable()->comment('兼容SS');
             $table->tinyInteger('single')->default('0')->nullable()->comment('单端口多用户');
             $table->tinyInteger('single_force')->default('0')->nullable()->comment('模式:0-兼容模式、1-严格模式');

+ 2 - 0
database/migrations/2017_12_29_140111_create_ss_node_info_table.php

@@ -15,6 +15,8 @@ class CreateSsNodeInfoTable extends Migration
     {
         Schema::create('ss_node_info', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('node_id')->default('0')->comment('节点ID');

+ 2 - 0
database/migrations/2017_12_29_140125_create_ss_node_online_log_table.php

@@ -15,6 +15,8 @@ class CreateSsNodeOnlineLogTable extends Migration
     {
         Schema::create('ss_node_online_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('node_id')->default('0')->comment('节点ID');

+ 2 - 0
database/migrations/2017_12_29_140140_create_ss_node_traffic_daily_table.php

@@ -15,6 +15,8 @@ class CreateSsNodeTrafficDailyTable extends Migration
     {
         Schema::create('ss_node_traffic_daily', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('node_id')->default('0')->comment('节点ID');

+ 2 - 0
database/migrations/2017_12_29_140153_create_ss_node_traffic_hourly_table.php

@@ -15,6 +15,8 @@ class CreateSsNodeTrafficHourlyTable extends Migration
     {
         Schema::create('ss_node_traffic_hourly', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('node_id')->default('0')->comment('节点ID');

+ 2 - 0
database/migrations/2017_12_29_140205_create_ticket_table.php

@@ -15,6 +15,8 @@ class CreateTicketTable extends Migration
     {
         Schema::create('ticket', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140216_create_ticket_reply_table.php

@@ -15,6 +15,8 @@ class CreateTicketReplyTable extends Migration
     {
         Schema::create('ticket_reply', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('ticket_id')->default('0')->comment('工单ID');

+ 2 - 2
database/migrations/2017_12_29_140229_create_user_table.php

@@ -15,6 +15,8 @@ class CreateUserTable extends Migration
     {
         Schema::create('user', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->string('username', 128)->default('')->comment('用户名');
@@ -54,8 +56,6 @@ class CreateUserTable extends Migration
             $table->string('remember_token', 255)->default('')->nullable();
             $table->dateTime('created_at')->nullable();
             $table->dateTime('updated_at')->nullable();
-
-            $table->unique('port');
         });
     }
 

+ 2 - 0
database/migrations/2017_12_29_140239_create_user_balance_log_table.php

@@ -15,6 +15,8 @@ class CreateUserBalanceLogTable extends Migration
     {
         Schema::create('user_balance_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140253_create_user_ban_log_table.php

@@ -15,6 +15,8 @@ class CreateUserBanLogTable extends Migration
     {
         Schema::create('user_ban_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140304_create_user_score_log_table.php

@@ -15,6 +15,8 @@ class CreateUserScoreLogTable extends Migration
     {
         Schema::create('user_score_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140319_create_user_subscribe_table.php

@@ -15,6 +15,8 @@ class CreateUserSubscribeTable extends Migration
     {
         Schema::create('user_subscribe', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140330_create_user_subscribe_log_table.php

@@ -15,6 +15,8 @@ class CreateUserSubscribeLogTable extends Migration
     {
         Schema::create('user_subscribe_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('sid')->default('0')->comment('对应user_subscribe的id');

+ 2 - 0
database/migrations/2017_12_29_140345_create_user_traffic_daily_table.php

@@ -15,6 +15,8 @@ class CreateUserTrafficDailyTable extends Migration
     {
         Schema::create('user_traffic_daily', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140357_create_user_traffic_hourly_table.php

@@ -15,6 +15,8 @@ class CreateUserTrafficHourlyTable extends Migration
     {
         Schema::create('user_traffic_hourly', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140409_create_user_traffic_log_table.php

@@ -15,6 +15,8 @@ class CreateUserTrafficLogTable extends Migration
     {
         Schema::create('user_traffic_log', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 2 - 0
database/migrations/2017_12_29_140422_create_verify_table.php

@@ -15,6 +15,8 @@ class CreateVerifyTable extends Migration
     {
         Schema::create('verify', function (Blueprint $table) {
             $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
 
             $table->increments('id');
             $table->integer('user_id')->default('0')->comment('用户ID');

+ 39 - 0
database/migrations/2018_05_24_113606_create_goods_label_table.php

@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateGoodsLabelTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('goods_label', function (Blueprint $table) {
+            $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
+
+            $table->increments('id');
+            $table->integer('goods_id')->default('0')->comment('商品ID');
+            $table->integer('label_id')->default('0')->comment('标签ID');
+
+            $table->index('goods_id');
+            $table->index('label_id');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('goods_label');
+    }
+}

+ 47 - 0
database/migrations/2018_05_24_113645_create_payment_table.php

@@ -0,0 +1,47 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreatePaymentTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('payment', function (Blueprint $table) {
+            $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
+
+            $table->increments('id');
+            $table->char('sn', 50)->default('')->comment('订单唯一码');
+            $table->integer('user_id')->default('0')->comment('用户ID');
+            $table->integer('oid')->default('0')->comment('本地订单ID');
+            $table->string('order_sn', 50)->default('0')->comment('本地订单长ID');
+            $table->tinyInteger('pay_way')->default('1')->comment('支付方式:1-微信、2-支付宝');
+            $table->integer('amount')->default('0')->comment('金额,单位分');
+            $table->integer('qr_id')->default('0')->comment('有赞生成的支付单ID');
+            $table->string('qr_url', 255)->default('')->comment('有赞生成的支付二维码URL');
+            $table->text('qr_code')->nullable()->comment('有赞生成的支付二维码图片base64');
+            $table->string('qr_local_url', 255)->nullable()->comment('支付二维码的本地存储URL');
+            $table->tinyInteger('status')->default('0')->comment('状态:-1-支付失败、0-等待支付、1-支付成功');
+            $table->dateTime('created_at')->nullable();
+            $table->dateTime('updated_at')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('payment');
+    }
+}

+ 48 - 0
database/migrations/2018_05_24_113657_create_payment_callback_table.php

@@ -0,0 +1,48 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreatePaymentCallbackTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('payment_callback', function (Blueprint $table) {
+            $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
+
+            $table->increments('id');
+            $table->string('client_id', 50)->nullable();
+            $table->string('yz_id', 50)->nullable();
+            $table->string('kdt_id', 50)->nullable();
+            $table->string('kdt_name', 50)->nullable();
+            $table->tinyInteger('mode')->nullable();
+            $table->text('msg')->nullable();
+            $table->integer('sendCount')->default('0');
+            $table->string('sign', 32)->default('1');
+            $table->string('status', 30)->default('0');
+            $table->tinyInteger('test')->default('0');
+            $table->string('type', 50)->default('');
+            $table->string('version', 50)->nullable();
+            $table->dateTime('created_at')->nullable();
+            $table->dateTime('updated_at')->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('payment_callback');
+    }
+}

+ 36 - 0
database/migrations/2018_05_24_113825_create_label_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateLabelTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('label', function (Blueprint $table) {
+            $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
+
+            $table->increments('id');
+            $table->string('name', 255)->default('')->comment('名称');
+            $table->integer('sort')->default('0')->comment('排序值');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('label');
+    }
+}

+ 36 - 0
database/migrations/2018_05_24_113851_create_user_label_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateUserLabelTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('user_label', function (Blueprint $table) {
+            $table->engine = 'InnoDB';
+            $table->charset = 'utf8mb4';
+            $table->collation = 'utf8mb4_unicode_ci';
+
+            $table->increments('id');
+            $table->integer('user_id')->default('0')->comment('用户ID');
+            $table->integer('label_id')->default('0')->comment('标签ID');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('user_label');
+    }
+}

+ 1 - 1
resources/lang/zh-CN/home.php

@@ -96,7 +96,7 @@ return [
     'service_type_2'                  => '套餐',
 
     // 流量日志
-    'traffic_log_tips'                => '提示:流量统计图更新会有延迟。按天统计图在次日更新,按小时统计图在次小时更新。',
+    'traffic_log_tips'                => '提示流量统计图更新会有延迟。按天统计图在次日更新,按小时统计图在次小时更新。',
     'traffic_log_30days'              => '最近 30 天的流量使用情况',
     'traffic_log_24hours'             => '最近 24 小时的流量使用情况',
     'traffic_log_keywords'            => '使用流量',

+ 5 - 5
resources/lang/zh-tw/home.php

@@ -5,7 +5,7 @@ return [
     'subscribe_address'               => '我的訂閱地址',
     'copy_subscribe_address'          => '複製',
     'exchange_subscribe'              => '更換',
-    'subscribe_warning'               => '注意:該訂閱地址僅限個人使用,請勿傳播該地址,這會導致您的帳號流量使用情况异常。',
+    'subscribe_warning'               => '注意該訂閱地址僅限個人使用,請勿傳播該地址,這會導致您的帳號流量使用情况异常。',
     'reset_password_title'            => '重置密碼',
     'system_down'                     => '系統維護中',
     'subscribe_baned'                 => '您的訂閱功能被暫時禁用,請聯系管理員恢復',
@@ -49,7 +49,7 @@ return [
     'close'                           => '取消',
     'redeem_score'                    => '兌換流量',
     'redeem'                          => '立即兌換',
-    'redeem_info'                     => '您有:score積分,可兌換:scoreM免費流量。',
+    'redeem_info'                     => '您有:score積分,可兌換:scoreM免費流量。',
     'coupon_code'                     => '優惠券碼',
     'please_input_coupon'             => '請輸入優惠券碼',
     'scan_qrcode'                     => '請使用用戶端掃描二維碼',
@@ -96,7 +96,7 @@ return [
     'service_type_2'                  => '套餐',
 
     // 流量日志
-    'traffic_log_tips'                => '提示:流量統計圖更新會有延遲。按天統計圖在次日更新,按小時統計圖在次小時更新。',
+    'traffic_log_tips'                => '提示流量統計圖更新會有延遲。按天統計圖在次日更新,按小時統計圖在次小時更新。',
     'traffic_log_30days'              => '最近 30 天的流量使用情况',
     'traffic_log_24hours'             => '最近 24 小時的流量使用情况',
     'traffic_log_keywords'            => '使用流量',
@@ -160,9 +160,9 @@ return [
     'referral_table_date'             => '返利時間',
     'referral_table_none'             => '暫無數據',
     'referral_table_apply'            => '提現',
-    'referral_summary'                => '合計返利 :amount元(:total次),滿:money元可以申請提現。',
+    'referral_summary'                => '合計返利:amount元(:total次),滿:money元可以申請提現。',
     'console'                         => '管理中心',
     'profile'                         => '個人設置',
     'logout'                          => '登出',
-    'promote'                         => '通過您的推廣連結注册並啟動,您和新用戶都會獲得:traffic流量獎勵;當他們消費時,您將獲得他們消費金額的:referral_percent%作為獎勵。',
+    'promote'                         => '通過您的推廣連結注册並啟動,您和新用戶都會獲得:traffic流量獎勵;當他們消費時,您將獲得他們消費金額的:referral_percent%作為獎勵。',
 ];

+ 58 - 57
sql/db.sql

@@ -28,16 +28,16 @@ CREATE TABLE `ss_node` (
   `name` VARCHAR(128) NOT NULL DEFAULT '' COMMENT '名称',
   `group_id` INT(11) NOT NULL DEFAULT '0' COMMENT '所属分组',
   `country_code` CHAR(5) NULL DEFAULT '' COMMENT '国家代码',
-  `server` VARCHAR(128) NULL DEFAULT NULL COMMENT '服务器域名地址',
-  `ip` CHAR(15) NULL DEFAULT NULL COMMENT '服务器IPV4地址',
-  `ipv6` CHAR(128) NULL DEFAULT NULL COMMENT '服务器IPV6地址',
+  `server` VARCHAR(128) NULL DEFAULT '' COMMENT '服务器域名地址',
+  `ip` CHAR(15) NULL DEFAULT '' COMMENT '服务器IPV4地址',
+  `ipv6` CHAR(128) NULL DEFAULT '' COMMENT '服务器IPV6地址',
   `desc` VARCHAR(255) NULL DEFAULT '' COMMENT '节点简单描述',
   `method` VARCHAR(32) NOT NULL DEFAULT 'aes-192-ctr' COMMENT '加密方式',
   `protocol` VARCHAR(128) NOT NULL DEFAULT 'auth_chain_a' COMMENT '协议',
   `protocol_param` VARCHAR(128) NULL DEFAULT '' COMMENT '协议参数',
   `obfs` VARCHAR(128) NOT NULL DEFAULT 'tls1.2_ticket_auth' COMMENT '混淆',
   `obfs_param` VARCHAR(128) NULL DEFAULT '' COMMENT '混淆参数',
-  `traffic_rate` FLOAT NOT NULL DEFAULT '1' COMMENT '流量比率',
+  `traffic_rate` FLOAT NOT NULL DEFAULT '1.00' COMMENT '流量比率',
   `bandwidth` INT(11) NOT NULL DEFAULT '100' COMMENT '出口带宽,单位M',
   `traffic` BIGINT(20) NOT NULL DEFAULT '1000' COMMENT '每月可用流量,单位G',
   `monitor_url` VARCHAR(255) NULL DEFAULT NULL COMMENT '监控地址',
@@ -57,6 +57,7 @@ CREATE TABLE `ss_node` (
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='节点信息表';
 
+
 -- ----------------------------
 -- Table structure for `ss_node_info`
 -- ----------------------------
@@ -113,7 +114,6 @@ CREATE TABLE `user` (
   `t` int(11) NOT NULL DEFAULT '0' COMMENT '最后使用时间',
   `enable` tinyint(4) NOT NULL DEFAULT '1' COMMENT 'SS状态',
   `method` varchar(30) NOT NULL DEFAULT 'aes-192-ctr' COMMENT '加密方式',
-  `custom_method` varchar(30) DEFAULT 'aes-192-ctr' COMMENT '自定义加密方式',
   `protocol` varchar(30) NOT NULL DEFAULT 'auth_chain_a' COMMENT '协议',
   `protocol_param` varchar(255) DEFAULT '' COMMENT '协议参数',
   `obfs` varchar(30) NOT NULL DEFAULT 'tls1.2_ticket_auth' COMMENT '混淆',
@@ -141,8 +141,7 @@ CREATE TABLE `user` (
   `remember_token` varchar(256) DEFAULT '',
   `created_at` datetime DEFAULT NULL,
   `updated_at` datetime DEFAULT NULL,
-  PRIMARY KEY (`id`),
-  UNIQUE KEY `port` (`port`)
+  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
@@ -204,56 +203,58 @@ CREATE TABLE `user_traffic_log` (
 -- ----------------------------
 DROP TABLE IF EXISTS `ss_config`;
 CREATE TABLE `ss_config` (
-  `id` int(11) NOT NULL AUTO_INCREMENT,
-  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '配置名',
-  `type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '类型:1-加密方式、2-协议、3-混淆',
-  `is_default` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否默认:0-不是、1-是',
-  `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序:值越大排越前',
-  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
-  `updated_at` datetime DEFAULT NULL COMMENT '最后更新时间',
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `name` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '配置名' COLLATE 'utf8mb4_unicode_ci',
+  `type` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '类型:1-加密方式、2-协议、3-混淆',
+  `is_default` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '是否默认:0-不是、1-是',
+  `sort` INT(11) NOT NULL DEFAULT '0' COMMENT '排序:值越大排越前',
   PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+) ENGINE=InnoDB AUTO_INCREMENT=38 CHARSET=utf8mb4 COLLATE='utf8mb4_unicode_ci';
 
 -- ----------------------------
 -- Records of ss_config
 -- ----------------------------
-INSERT INTO `ss_config` VALUES ('1', 'none', '1', '0', '0', '2017-08-01 13:12:23', '2017-08-01 13:12:23');
-INSERT INTO `ss_config` VALUES ('2', 'rc4-md5', '1', '0', '0', '2017-08-01 13:12:29', '2017-08-01 13:12:29');
-INSERT INTO `ss_config` VALUES ('3', 'bf-cfb', '1', '0', '0', '2017-08-01 13:13:05', '2017-08-01 13:13:05');
-INSERT INTO `ss_config` VALUES ('4', 'aes-128-cfb', '1', '0', '0', '2017-08-01 13:13:13', '2017-08-01 13:13:13');
-INSERT INTO `ss_config` VALUES ('5', 'aes-192-cfb', '1', '0', '0', '2017-08-01 13:13:25', '2017-08-01 13:13:25');
-INSERT INTO `ss_config` VALUES ('6', 'aes-256-cfb', '1', '0', '0', '2017-08-01 13:13:39', '2017-08-01 13:13:39');
-INSERT INTO `ss_config` VALUES ('7', 'aes-128-ctr', '1', '0', '0', '2017-08-01 13:13:46', '2017-08-01 13:13:46');
-INSERT INTO `ss_config` VALUES ('8', 'aes-192-ctr', '1', '1', '0', '2017-08-01 13:13:53', '2017-08-01 13:13:53');
-INSERT INTO `ss_config` VALUES ('9', 'aes-256-ctr', '1', '0', '0', '2017-08-01 13:14:00', '2017-08-01 13:14:00');
-INSERT INTO `ss_config` VALUES ('10', 'camellia-128-cfb', '1', '0', '0', '2017-08-01 13:14:08', '2017-08-01 13:14:08');
-INSERT INTO `ss_config` VALUES ('11', 'camellia-192-cfb', '1', '0', '0', '2017-08-01 13:14:12', '2017-08-01 13:14:12');
-INSERT INTO `ss_config` VALUES ('12', 'camellia-256-cfb', '1', '0', '0', '2017-08-01 13:14:51', '2017-08-01 13:14:51');
-INSERT INTO `ss_config` VALUES ('13', 'salsa20', '1', '0', '0', '2017-08-01 13:15:09', '2017-08-01 13:15:09');
-INSERT INTO `ss_config` VALUES ('14', 'chacha20', '1', '0', '0', '2017-08-01 13:15:16', '2017-08-01 13:15:16');
-INSERT INTO `ss_config` VALUES ('15', 'chacha20-ietf', '1', '0', '0', '2017-08-01 13:15:27', '2017-08-01 13:15:27');
-INSERT INTO `ss_config` VALUES ('16', 'chacha20-ietf-poly1305', '1', '0', '0', '2017-08-01 13:15:39', '2017-08-01 13:15:39');
-INSERT INTO `ss_config` VALUES ('17', 'chacha20-poly1305', '1', '0', '0', '2017-08-01 13:15:46', '2017-08-01 13:15:46');
-INSERT INTO `ss_config` VALUES ('18', 'xchacha-ietf-poly1305', '1', '0', '0', '2017-08-01 13:21:51', '2017-08-01 13:21:51');
-INSERT INTO `ss_config` VALUES ('19', 'aes-128-gcm', '1', '0', '0', '2017-08-01 13:22:05', '2017-08-01 13:22:05');
-INSERT INTO `ss_config` VALUES ('20', 'aes-192-gcm', '1', '0', '0', '2017-08-01 13:22:12', '2017-08-01 13:22:12');
-INSERT INTO `ss_config` VALUES ('21', 'aes-256-gcm', '1', '0', '0', '2017-08-01 13:22:19', '2017-08-01 13:22:19');
-INSERT INTO `ss_config` VALUES ('22', 'sodium-aes-256-gcm', '1', '0', '0', '2017-08-01 13:22:32', '2017-08-01 13:22:32');
-INSERT INTO `ss_config` VALUES ('23', 'origin', '2', '0', '0', '2017-08-01 13:23:57', '2017-08-01 13:23:57');
-INSERT INTO `ss_config` VALUES ('24', 'auth_sha1_v4', '2', '0', '0', '2017-08-01 13:24:41', '2017-08-01 13:24:41');
-INSERT INTO `ss_config` VALUES ('25', 'auth_aes128_md5', '2', '0', '0', '2017-08-01 13:24:58', '2017-08-01 13:24:58');
-INSERT INTO `ss_config` VALUES ('26', 'auth_aes128_sha1', '2', '0', '0', '2017-08-01 13:25:11', '2017-08-01 13:25:11');
-INSERT INTO `ss_config` VALUES ('27', 'auth_chain_a', '2', '1', '0', '2017-08-01 13:25:24', '2017-08-01 13:25:24');
-INSERT INTO `ss_config` VALUES ('28', 'auth_chain_b', '2', '0', '0', '2017-08-01 14:02:31', '2017-08-01 14:02:31');
-INSERT INTO `ss_config` VALUES ('29', 'plain', '3', '0', '0', '2017-08-01 13:29:14', '2017-08-01 13:29:14');
-INSERT INTO `ss_config` VALUES ('30', 'http_simple', '3', '0', '0', '2017-08-01 13:29:30', '2017-08-01 13:29:30');
-INSERT INTO `ss_config` VALUES ('31', 'http_post', '3', '0', '0', '2017-08-01 13:29:38', '2017-08-01 13:29:38');
-INSERT INTO `ss_config` VALUES ('32', 'tls1.2_ticket_auth', '3', '1', '0', '2017-08-01 13:29:51', '2017-08-01 13:29:51');
-INSERT INTO `ss_config` VALUES ('33', 'tls1.2_ticket_fastauth', '3', '0', '0', '2017-08-01 14:02:19', '2017-08-01 14:02:19');
-INSERT INTO `ss_config` VALUES ('34', 'auth_chain_c', '2', '0', '0', '2017-08-01 14:02:31', '2017-08-01 14:02:31');
-INSERT INTO `ss_config` VALUES ('35', 'auth_chain_d', '2', '0', '0', '2017-08-01 14:02:31', '2017-08-01 14:02:31');
-INSERT INTO `ss_config` VALUES ('36', 'auth_chain_e', '2', '0', '0', '2017-08-01 14:02:31', '2017-08-01 14:02:31');
-INSERT INTO `ss_config` VALUES ('37', 'auth_chain_f', '2', '0', '0', '2017-08-01 14:02:31', '2017-08-01 14:02:31');
+INSERT INTO `ss_config` VALUES ('1', 'none', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('2', 'rc4', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('3', 'rc4-md5', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('4', 'rc4-md5-6', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('5', 'bf-cfb', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('6', 'aes-128-cfb', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('7', 'aes-192-cfb', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('8', 'aes-256-cfb', '1', '1', '0');
+INSERT INTO `ss_config` VALUES ('9', 'aes-128-ctr', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('10', 'aes-192-ctr', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('11', 'aes-256-ctr', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('12', 'camellia-128-cfb', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('13', 'camellia-192-cfb', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('14', 'camellia-256-cfb', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('15', 'salsa20', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('16', 'xsalsa20', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('17', 'chacha20', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('18', 'xchacha20', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('19', 'chacha20-ietf', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('20', 'chacha20-ietf-poly1305', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('21', 'chacha20-poly1305', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('22', 'xchacha-ietf-poly1305', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('23', 'aes-128-gcm', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('24', 'aes-192-gcm', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('25', 'aes-256-gcm', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('26', 'sodium-aes-256-gcm', '1', '0', '0');
+INSERT INTO `ss_config` VALUES ('27', 'origin', '2', '1', '0');
+INSERT INTO `ss_config` VALUES ('28', 'auth_sha1_v4', '2', '0', '0');
+INSERT INTO `ss_config` VALUES ('29', 'auth_aes128_md5', '2', '0', '0');
+INSERT INTO `ss_config` VALUES ('30', 'auth_aes128_sha1', '2', '0', '0');
+INSERT INTO `ss_config` VALUES ('31', 'auth_chain_a', '2', '0', '0');
+INSERT INTO `ss_config` VALUES ('32', 'auth_chain_b', '2', '0', '0');
+INSERT INTO `ss_config` VALUES ('33', 'plain', '3', '1', '0');
+INSERT INTO `ss_config` VALUES ('34', 'http_simple', '3', '0', '0');
+INSERT INTO `ss_config` VALUES ('35', 'http_post', '3', '0', '0');
+INSERT INTO `ss_config` VALUES ('36', 'tls1.2_ticket_auth', '3', '0', '0');
+INSERT INTO `ss_config` VALUES ('37', 'tls1.2_ticket_fastauth', '3', '0', '0');
+INSERT INTO `ss_config` VALUES ('38', 'auth_chain_c', '2', '0', '0');
+INSERT INTO `ss_config` VALUES ('39', 'auth_chain_d', '2', '0', '0');
+INSERT INTO `ss_config` VALUES ('40', 'auth_chain_e', '2', '0', '0');
+INSERT INTO `ss_config` VALUES ('41', 'auth_chain_f', '2', '0', '0');
 
 
 -- ----------------------------
@@ -335,7 +336,7 @@ INSERT INTO `config` VALUES ('57', 'register_ip_limit', 5);
 CREATE TABLE `article` (
   `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
   `title` varchar(100) NOT NULL DEFAULT '' COMMENT '标题',
-  `author` varchar(255) DEFAULT '' COMMENT '作者',
+  `author` varchar(50) DEFAULT '' COMMENT '作者',
   `content` text COMMENT '内容',
   `type` tinyint(4) DEFAULT '1' COMMENT '类型:1-文章、2-公告',
   `is_del` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除',
@@ -405,7 +406,7 @@ CREATE TABLE `verify` (
 CREATE TABLE `ss_group` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '分组名称',
-  `level` tinyint(4) NOT NULL DEFAULT '1' COMMENT '分组级别,对应账号级别',
+  `level` tinyint(4) NOT NULL DEFAULT '1' COMMENT '分组级别',
   `created_at` datetime DEFAULT NULL,
   `updated_at` datetime DEFAULT NULL,
   PRIMARY KEY (`id`)
@@ -473,8 +474,8 @@ CREATE TABLE `coupon` (
 CREATE TABLE `coupon_log` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `coupon_id` int(11) NOT NULL DEFAULT '0' COMMENT '优惠券ID',
-  `goods_id` int(11) NOT NULL COMMENT '商品ID',
-  `order_id` int(11) NOT NULL COMMENT '订单ID',
+  `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品ID',
+  `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单ID',
   `created_at` datetime DEFAULT NULL COMMENT '创建时间',
   `updated_at` datetime DEFAULT NULL COMMENT '最后更新时间',
   PRIMARY KEY (`id`)
@@ -853,7 +854,7 @@ CREATE TABLE `payment` (
   `user_id` int(11) NOT NULL COMMENT '用户ID',
   `oid` int(11) DEFAULT NULL COMMENT '本地订单ID',
   `order_sn` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '本地订单长ID',
-  `pay_way` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '1' COMMENT '支付方式:1-微信、2-支付宝',
+  `pay_way` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '支付方式:1-微信、2-支付宝',
   `amount` int(11) NOT NULL DEFAULT '0' COMMENT '金额,单位分',
   `qr_id` int(11) NOT NULL DEFAULT '0' COMMENT '有赞生成的支付单ID',
   `qr_url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '有赞生成的支付二维码URL',