正在显示
1 个修改的文件
包含
5 行增加
和
3 行删除
| @@ -614,11 +614,13 @@ class ProjectLogic extends BaseLogic | @@ -614,11 +614,13 @@ class ProjectLogic extends BaseLogic | ||
| 614 | } | 614 | } |
| 615 | $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$v}"); | 615 | $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']); | 616 | DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']); |
| 617 | + } | ||
| 618 | + foreach ($table as $v1){ | ||
| 617 | // 执行同步数据的操作 | 619 | // 执行同步数据的操作 |
| 618 | - DB::connection('custom_mysql')->insert("INSERT INTO {$v} SELECT * FROM custom_tmp_mysql_copy.{$v}"); | 620 | + DB::connection('custom_mysql')->insert("INSERT INTO {$v1} SELECT * FROM custom_tmp_mysql_copy.{$v1}"); |
| 619 | 621 | ||
| 620 | - if (Schema::connection('custom_mysql')->hasColumn($v, 'project_id')) { | ||
| 621 | - DB::connection('custom_mysql')->table($v)->update(['project_id' => $news_project_id]); | 622 | + if (Schema::connection('custom_mysql')->hasColumn($v1, 'project_id')) { |
| 623 | + DB::connection('custom_mysql')->table($v1)->update(['project_id' => $news_project_id]); | ||
| 622 | } | 624 | } |
| 623 | } | 625 | } |
| 624 | return true; | 626 | return true; |
-
请 注册 或 登录 后发表评论