|
@@ -506,7 +506,7 @@ def save_ranking_tables(entity_type, ranking_by, ranking_tables) {
|
|
t.rename!(['entity_id', 'category_id'], [entity_id_col, category_id_col]);
|
|
t.rename!(['entity_id', 'category_id'], [entity_id_col, category_id_col]);
|
|
}
|
|
}
|
|
|
|
|
|
- save_and_sync(t, source_table, target_table);
|
|
|
|
|
|
+ save_and_sync(t, source_table, target_table, entity_id_col, 'end_date');
|
|
|
|
|
|
t = ranking_tables[1];
|
|
t = ranking_tables[1];
|
|
if(ranking_by == 'bfi') {
|
|
if(ranking_by == 'bfi') {
|
|
@@ -518,7 +518,7 @@ def save_ranking_tables(entity_type, ranking_by, ranking_tables) {
|
|
t.rename!('category_id', category_id_col);
|
|
t.rename!('category_id', category_id_col);
|
|
}
|
|
}
|
|
|
|
|
|
- save_and_sync(t, source_table + '_num', target_table + '_num');
|
|
|
|
|
|
+ save_and_sync(t, source_table + '_num', target_table + '_num', entity_id_col, 'end_date');
|
|
|
|
|
|
// 基金有二级策略排名
|
|
// 基金有二级策略排名
|
|
if(ranking_by == 'strategy' && entity_type IN ['HF', 'MF']) {
|
|
if(ranking_by == 'strategy' && entity_type IN ['HF', 'MF']) {
|
|
@@ -528,10 +528,10 @@ def save_ranking_tables(entity_type, ranking_by, ranking_tables) {
|
|
category_id_col = 'substrategy';
|
|
category_id_col = 'substrategy';
|
|
|
|
|
|
t = ranking_tables[2];
|
|
t = ranking_tables[2];
|
|
- save_and_sync(t.rename!(['entity_id', 'category_id'], [entity_id_col, category_id_col]), source_table, target_table);
|
|
|
|
|
|
+ save_and_sync(t.rename!(['entity_id', 'category_id'], [entity_id_col, category_id_col]), source_table, target_table, entity_id_col, 'end_date');
|
|
|
|
|
|
t = ranking_tables[3];
|
|
t = ranking_tables[3];
|
|
- save_and_sync(t.rename!('category_id', category_id_col), source_table + '_num', target_table + '_num');
|
|
|
|
|
|
+ save_and_sync(t.rename!('category_id', category_id_col), source_table + '_num', target_table + '_num', entity_id_col, 'end_date');
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -572,7 +572,7 @@ def save_relative_ranking_table(entity_type, ranking_table, ranking_by) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- save_and_sync(ranking_table, source_table, target_table);
|
|
|
|
|
|
+ save_and_sync(ranking_table, source_table, target_table, entity_id_col, 'end_date');
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|