|
@@ -119,6 +119,22 @@ class StatTreeLine extends Model
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // report columns
|
|
|
|
+ foreach ($this->reportColumns as $srcReportColumn) {
|
|
|
|
+ $newStatTreeLineReportColumn = new StatTreeLineReportColumn();
|
|
|
|
+ $nextId = DB::select("select nextval('stat_tree_line_report_column_id_seq')");
|
|
|
|
+ $newStatTreeLineReportColumn->id = $nextId[0]->nextval;
|
|
|
|
+ $newStatTreeLineReportColumn->uid = Uuid::uuid4();
|
|
|
|
+ $newStatTreeLineReportColumn->stat_tree_line_id = $newStatTreeLine->id;
|
|
|
|
+ $newStatTreeLineReportColumn->label = $srcReportColumn->label;
|
|
|
|
+ $newStatTreeLineReportColumn->position_index = $srcReportColumn->position_index;
|
|
|
|
+ $newStatTreeLineReportColumn->display_key = $srcReportColumn->display_key;
|
|
|
|
+ $newStatTreeLineReportColumn->display_function = $srcReportColumn->display_function;
|
|
|
|
+ $newStatTreeLineReportColumn->record_route_name = $srcReportColumn->record_route_name;
|
|
|
|
+ $newStatTreeLineReportColumn->stat_tree_id = $newStatTree->id;
|
|
|
|
+ $newStatTreeLineReportColumn->save();
|
|
|
|
+ }
|
|
|
|
+
|
|
foreach ($this->children as $child) {
|
|
foreach ($this->children as $child) {
|
|
$child->copy($newStatTreeLine, $newStatTree);
|
|
$child->copy($newStatTreeLine, $newStatTree);
|
|
}
|
|
}
|