Commit d11b86fd authored by yinxiaoling's avatar yinxiaoling

初始化建表

parent 6eed3133
...@@ -21,7 +21,7 @@ class LoginApiController extends BaseController ...@@ -21,7 +21,7 @@ class LoginApiController extends BaseController
if($url != substr(md5(json_encode($param)),1,8)){ if($url != substr(md5(json_encode($param)),1,8)){
return $this->errorWithInfo('url验证不通过', 401); return $this->errorWithInfo('url验证不通过', 401);
} }
if(empty($param['username']) || empty($param['password'] )|| empty($param['from'] ) || $param['from'] != 2){ if(empty($param['username']) || empty($param['password'] )){
return $this->errorWithInfo('参数验证不通过', 401); return $this->errorWithInfo('参数验证不通过', 401);
} }
......
...@@ -16,7 +16,6 @@ class DatabaseSeeder extends Seeder ...@@ -16,7 +16,6 @@ class DatabaseSeeder extends Seeder
// $this->call(UsersTableSeeder::class); // $this->call(UsersTableSeeder::class);
$tableName = 'strategy_set';//策略设置表 $tableName = 'strategy_set';//策略设置表
if(!Schema::hasTable($tableName)){ if(!Schema::hasTable($tableName)){
//创建表语句
Schema::create($tableName, function (Blueprint $table){ Schema::create($tableName, function (Blueprint $table){
$table->increments('id'); $table->increments('id');
$table->string('strategy_sn'); //sn编号 $table->string('strategy_sn'); //sn编号
...@@ -36,7 +35,7 @@ class DatabaseSeeder extends Seeder ...@@ -36,7 +35,7 @@ class DatabaseSeeder extends Seeder
$table->timestamp('created_at')->nullable(); $table->timestamp('created_at')->nullable();
}); });
//加索引 //加索引
Schema::table('seating_assistance_project_set', function ($table){ Schema::table($tableName, function ($table){
$table->index('strategy_sn'); $table->index('strategy_sn');
$table->index('disabled'); $table->index('disabled');
}); });
...@@ -48,7 +47,6 @@ class DatabaseSeeder extends Seeder ...@@ -48,7 +47,6 @@ class DatabaseSeeder extends Seeder
$tableName = 'strategy_excel';//策略excel数据记录表 $tableName = 'strategy_excel';//策略excel数据记录表
if(!Schema::hasTable($tableName)){ if(!Schema::hasTable($tableName)){
//创建表语句
Schema::create($tableName, function (Blueprint $table){ Schema::create($tableName, function (Blueprint $table){
$table->increments('id'); $table->increments('id');
$table->string('strategy_sn'); //sn编号 $table->string('strategy_sn'); //sn编号
...@@ -58,14 +56,13 @@ class DatabaseSeeder extends Seeder ...@@ -58,14 +56,13 @@ class DatabaseSeeder extends Seeder
$table->timestamp('created_at')->nullable(); $table->timestamp('created_at')->nullable();
}); });
//加索引 //加索引
Schema::table('seating_assistance_project_set', function ($table){ Schema::table($tableName, function ($table){
$table->index('strategy_sn'); $table->index('strategy_sn');
}); });
} }
$tableName = 'strategy_task';//任务数据(任务已建未建) $tableName = 'strategy_task';//任务数据(任务已建未建)
if(!Schema::hasTable($tableName)){ if(!Schema::hasTable($tableName)){
//创建表语句
Schema::create($tableName, function (Blueprint $table){ Schema::create($tableName, function (Blueprint $table){
$table->increments('id'); $table->increments('id');
$table->string('name'); //sn编号 $table->string('name'); //sn编号
...@@ -83,7 +80,7 @@ class DatabaseSeeder extends Seeder ...@@ -83,7 +80,7 @@ class DatabaseSeeder extends Seeder
$table->timestamp('created_at')->nullable(); $table->timestamp('created_at')->nullable();
}); });
//加索引 //加索引
Schema::table('seating_assistance_project_set', function ($table){ Schema::table($tableName, function ($table){
$table->index('is_created'); $table->index('is_created');
$table->index('phone'); $table->index('phone');
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment