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