Skip to content

Commit 4f5cb21

Browse files
author
zhangjiangbin
committed
1.修正数据迁移生成的表结构不兼容问题
2.移除节点、用户中的custom_method字段(无用) 3.移除文章访问日志(实验性功能,废弃)
1 parent 5dca43b commit 4f5cb21

File tree

44 files changed

+98
-542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+98
-542
lines changed

app/Console/Commands/AutoGetLocationInfoJob.php

Lines changed: 0 additions & 84 deletions
This file was deleted.

app/Console/Kernel.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class Kernel extends ConsoleKernel
2222
\App\Console\Commands\AutoDisableUserJob::class,
2323
\App\Console\Commands\AutoExpireCouponJob::class,
2424
\App\Console\Commands\AutoExpireInviteJob::class,
25-
\App\Console\Commands\AutoGetLocationInfoJob::class,
2625
\App\Console\Commands\AutoReopenUserJob::class,
2726
\App\Console\Commands\AutoResetUserTrafficJob::class,
2827
\App\Console\Commands\AutoStatisticsNodeDailyTrafficJob::class,
@@ -50,7 +49,6 @@ protected function schedule(Schedule $schedule)
5049
$schedule->command('command:autoDisableUserJob')->everyMinute();
5150
$schedule->command('command:autoExpireCouponJob')->everyThirtyMinutes();
5251
$schedule->command('command:autoExpireInviteJob')->everyThirtyMinutes();
53-
//$schedule->command('command:autoGetLocationInfoJob')->everyMinute();
5452
$schedule->command('command:autoReopenUserJob')->everyMinute();
5553
$schedule->command('command:autoResetUserTrafficJob')->everyFiveMinutes();
5654
$schedule->command('command:autoStatisticsNodeDailyTrafficJob')->dailyAt('04:30');

app/Http/Controllers/AdminController.php

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ public function addUser(Request $request)
154154
$user->transfer_enable = $this->toGB($request->get('transfer_enable', 0));
155155
$user->enable = $request->get('enable', 0);
156156
$user->method = $request->get('method');
157-
$user->custom_method = $request->get('method');
158157
$user->protocol = $request->get('protocol', '');
159158
$user->protocol_param = $request->get('protocol_param', '');
160159
$user->obfs = $request->get('obfs', '');
@@ -207,14 +206,14 @@ public function batchAddUsers(Request $request)
207206
$user = new User();
208207
$user->username = '批量生成-' . $this->makeRandStr(6);
209208
$user->password = md5($this->makeRandStr());
210-
$user->enable = 0;
209+
$user->enable = 1;
211210
$user->port = $port;
212211
$user->passwd = $this->makeRandStr();
213212
$user->transfer_enable = $this->toGB(1000);
214213
$user->enable_time = date('Y-m-d');
215214
$user->expire_time = date('Y-m-d', strtotime("+365 days"));
216215
$user->reg_ip = $request->getClientIp();
217-
$user->status = -1;
216+
$user->status = 0;
218217
$user->save();
219218
}
220219

@@ -241,7 +240,6 @@ public function editUser(Request $request)
241240
$transfer_enable = $request->get('transfer_enable');
242241
$enable = $request->get('enable');
243242
$method = $request->get('method');
244-
//$custom_method = $request->get('custom_method');
245243
$protocol = $request->get('protocol');
246244
$protocol_param = $request->get('protocol_param', '');
247245
$obfs = $request->get('obfs');
@@ -267,7 +265,6 @@ public function editUser(Request $request)
267265
'transfer_enable' => $this->toGB($transfer_enable),
268266
'enable' => $status < 0 ? 0 : $enable, // 如果禁止登陆则同时禁用SSR
269267
'method' => $method,
270-
'custom_method' => $method,
271268
'protocol' => $protocol,
272269
'protocol_param' => $protocol_param,
273270
'obfs' => $obfs,
@@ -364,11 +361,10 @@ public function addNode(Request $request)
364361
$ssNode = new SsNode();
365362
$ssNode->name = $request->get('name');
366363
$ssNode->group_id = $request->get('group_id', 0);
367-
$ssNode->country_code = $request->get('country_code', '');
364+
$ssNode->country_code = $request->get('country_code', 'un');
368365
$ssNode->server = $request->get('server');
369366
$ssNode->desc = $request->get('desc', '');
370367
$ssNode->method = $request->get('method');
371-
$ssNode->custom_method = $request->get('method');
372368
$ssNode->protocol = $request->get('protocol');
373369
$ssNode->protocol_param = $request->get('protocol_param');
374370
$ssNode->obfs = $request->get('obfs', '');
@@ -422,7 +418,6 @@ public function editNode(Request $request)
422418
$server = $request->get('server');
423419
$desc = $request->get('desc');
424420
$method = $request->get('method');
425-
//$custom_method = $request->get('custom_method');
426421
$protocol = $request->get('protocol');
427422
$protocol_param = $request->get('protocol_param');
428423
$obfs = $request->get('obfs');
@@ -449,7 +444,6 @@ public function editNode(Request $request)
449444
'server' => $server,
450445
'desc' => $desc,
451446
'method' => $method,
452-
'custom_method' => $method,
453447
'protocol' => $protocol,
454448
'protocol_param' => $protocol_param,
455449
'obfs' => $obfs,
@@ -574,14 +568,6 @@ public function articleList(Request $request)
574568
return Response::view('admin/articleList', $view);
575569
}
576570

577-
// 文章访问日志列表
578-
public function articleLogList(Request $request)
579-
{
580-
$view['articleLogList'] = ArticleLog::query()->paginate(10)->appends($request->except('page'));
581-
582-
return Response::view('admin/articleLogList', $view);
583-
}
584-
585571
// 添加文章
586572
public function addArticle(Request $request)
587573
{
@@ -972,7 +958,6 @@ public function import(Request $request)
972958
$obj->t = 0;
973959
$obj->enable = 1;
974960
$obj->method = $user->method;
975-
$obj->custom_method = $user->method;
976961
$obj->protocol = $user->protocol;
977962
$obj->protocol_param = $user->protocol_param;
978963
$obj->obfs = $user->obfs;

app/Http/Controllers/ArticleController.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

app/Http/Controllers/ShopController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function addGoods(Request $request)
4040
{
4141
if ($request->method() == 'POST') {
4242
$name = $request->get('name');
43-
$desc = $request->get('desc');
43+
$desc = $request->get('desc', '');
4444
$traffic = $request->get('traffic');
4545
$price = $request->get('price');
4646
$score = $request->get('score', 0);

database/migrations/2017_12_29_134159_create_article_table.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public function up()
1717
$table->engine = 'InnoDB';
1818

1919
$table->increments('id');
20-
$table->string('title', 100)->comment('文章标题');
21-
$table->string('author', 50)->comment('作者');
22-
$table->text('content')->comment('文章内容')->nullable();
20+
$table->string('title', 100)->default('')->comment('标题');
21+
$table->string('author', 50)->default('')->comment('作者');
22+
$table->text('content')->comment('内容')->nullable();
2323
$table->tinyInteger('is_del')->default('0')->comment('是否删除');
24-
$table->tinyInteger('type')->comment('类型:1-文章、2-公告');
24+
$table->tinyInteger('type')->default('1')->comment('类型:1-文章、2-公告');
2525
$table->integer('sort')->default('0')->comment('排序');
2626
$table->dateTime('created_at')->nullable();
2727
$table->dateTime('updated_at')->nullable();

database/migrations/2017_12_29_135653_create_article_log_table.php

Lines changed: 0 additions & 49 deletions
This file was deleted.

database/migrations/2017_12_29_135722_create_config_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public function up()
1717
$table->engine = 'InnoDB';
1818

1919
$table->increments('id');
20-
$table->string('name', 255)->comment('配置名');
21-
$table->string('value', 255)->comment('配置值');
20+
$table->string('name', 255)->default('')->comment('配置名');
21+
$table->string('value', 255)->default('')->comment('配置值');
2222
});
2323
}
2424

database/migrations/2017_12_29_135738_create_country_table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public function up()
1717
$table->engine = 'MyISAM';
1818

1919
$table->increments('id');
20-
$table->string('country_name', 50)->comment('名称');
21-
$table->string('country_code', 10)->comment('代码');
20+
$table->string('country_name', 50)->default('')->comment('名称');
21+
$table->string('country_code', 10)->default('')->comment('代码');
2222
});
2323
}
2424

database/migrations/2017_12_29_135751_create_coupon_table.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ public function up()
1717
$table->engine = 'InnoDB';
1818

1919
$table->increments('id');
20-
$table->string('name', 50)->comment('优惠券名称');
21-
$table->string('logo', 255)->comment('优惠券LOGO');
22-
$table->char('sn', 8)->comment('优惠券码');
23-
$table->tinyInteger('type')->default('1')->comment('类型:1-现金优惠、2-折扣优惠');
20+
$table->string('name', 50)->default('')->comment('优惠券名称');
21+
$table->string('logo', 255)->default('')->comment('优惠券LOGO');
22+
$table->char('sn', 8)->default('')->comment('优惠券码');
23+
$table->tinyInteger('type')->default('1')->comment('类型:1-现金券、2-折扣券、3-充值券');
2424
$table->tinyInteger('usage')->default('1')->comment('用途:1-仅限一次性使用、2-可重复使用');
25-
$table->integer('amount')->default('0')->comment('金额,单位分');
25+
$table->bigInteger('amount')->default('0')->comment('金额,单位分');
2626
$table->decimal('discount', 10, 2)->default('0.00')->comment('折扣');
27-
$table->integer('available_start')->comment('有效期开始');
28-
$table->integer('available_end')->comment('有效期结束');
27+
$table->integer('available_start')->default('0')->comment('有效期开始');
28+
$table->integer('available_end')->default('0')->comment('有效期结束');
2929
$table->tinyInteger('is_del')->default('0')->comment('是否已删除:0-未删除、1-已删除');
3030
$table->tinyInteger('status')->default('1')->comment('状态:0-未使用、1-已使用、2-已失效');
3131
$table->dateTime('created_at')->nullable();

0 commit comments

Comments
 (0)