|
@@ -37,6 +37,7 @@ class CopyProjectJob implements ShouldQueue |
|
@@ -37,6 +37,7 @@ class CopyProjectJob implements ShouldQueue |
|
37
|
*/
|
37
|
*/
|
|
38
|
public function __construct($data)
|
38
|
public function __construct($data)
|
|
39
|
{
|
39
|
{
|
|
|
|
40
|
+ $this->connection = 'copy_project';
|
|
40
|
$this->param = $data;
|
41
|
$this->param = $data;
|
|
41
|
}
|
42
|
}
|
|
42
|
|
43
|
|
|
@@ -160,7 +161,7 @@ class CopyProjectJob implements ShouldQueue |
|
@@ -160,7 +161,7 @@ class CopyProjectJob implements ShouldQueue |
|
160
|
$sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}");
|
161
|
$sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}");
|
|
161
|
DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']);
|
162
|
DB::connection('custom_mysql')->statement(get_object_vars($sql[0])['Create Table']);
|
|
162
|
}
|
163
|
}
|
|
163
|
- DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据
|
164
|
+// DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据
|
|
164
|
DB::connection('custom_mysql')->table($table)->insertUsing(
|
165
|
DB::connection('custom_mysql')->table($table)->insertUsing(
|
|
165
|
[], // 列名数组,留空表示插入所有列
|
166
|
[], // 列名数组,留空表示插入所有列
|
|
166
|
function ($query) use ($table,$project_id) {
|
167
|
function ($query) use ($table,$project_id) {
|