正在显示
1 个修改的文件
包含
6 行增加
和
4 行删除
| @@ -607,6 +607,8 @@ class ProjectLogic extends BaseLogic | @@ -607,6 +607,8 @@ class ProjectLogic extends BaseLogic | ||
| 607 | $database_name = DB::connection('custom_tmp_mysql_copy')->getDatabaseName(); | 607 | $database_name = DB::connection('custom_tmp_mysql_copy')->getDatabaseName(); |
| 608 | $table = Schema::connection('custom_tmp_mysql_copy')->getAllTables(); | 608 | $table = Schema::connection('custom_tmp_mysql_copy')->getAllTables(); |
| 609 | $table = array_column($table, 'Tables_in_' . $database_name); | 609 | $table = array_column($table, 'Tables_in_' . $database_name); |
| 610 | + var_dump($table); | ||
| 611 | + die(); | ||
| 610 | foreach ($table as $v) { | 612 | foreach ($table as $v) { |
| 611 | $has_table = Schema::connection('custom_mysql')->hasTable($v); | 613 | $has_table = Schema::connection('custom_mysql')->hasTable($v); |
| 612 | if ($has_table) { | 614 | if ($has_table) { |
| @@ -614,10 +616,10 @@ class ProjectLogic extends BaseLogic | @@ -614,10 +616,10 @@ class ProjectLogic extends BaseLogic | ||
| 614 | } | 616 | } |
| 615 | $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$v}"); | 617 | $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$v}"); |
| 616 | DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']); | 618 | DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']); |
| 617 | - $tables = Schema::getConnection()->getDoctrineSchemaManager()->listTableNames(); | ||
| 618 | - foreach ($table as $v1) { | ||
| 619 | - DB::connection('custom_mysql')->table($v1)->update(['project_id' => $news_project_id]); | ||
| 620 | - } | 619 | +// $tables = Schema::getConnection()->getDoctrineSchemaManager()->listTableNames(); |
| 620 | +// foreach ($table as $v1) { | ||
| 621 | +// DB::connection('custom_mysql')->table($v1)->update(['project_id' => $news_project_id]); | ||
| 622 | +// } | ||
| 621 | } | 623 | } |
| 622 | return true; | 624 | return true; |
| 623 | } | 625 | } |
-
请 注册 或 登录 后发表评论