作者 lyh

gx

... ... @@ -616,8 +616,9 @@ class ProjectLogic extends BaseLogic
DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据
DB::connection('custom_mysql')->table($table)->insertUsing(
[], // 列名数组,留空表示插入所有列
function ($query) use ($table) {
$query->select('*')->from("custom_tmp_mysql_copy.{$table}");
function ($query) use ($table,$project_id) {
$name = 'gl_data_'.$project_id.'.'.$table;
$query->select('*')->from("{$name}");
}
);
if (Schema::connection('custom_mysql')->hasColumn($table, 'project_id')) {
... ...