This commit is contained in:
BoHung Chiu 2022-04-01 16:38:50 +08:00
parent 3f3c966597
commit 1fa0351adf
1 changed files with 2 additions and 2 deletions

View File

@ -85,8 +85,8 @@ class Admin::UniversalTablesController < OrbitAdminController
if !table.nil?
sheet = workbook[0]
if sheet.count <= 503
columns = sheet[1].cells.collect{|c|
table.table_columns.where(:key => c.value.to_s).first rescue nil
columns = sheet[1].cells.collect.with_index{|c,i|
c.value.blank? ? table.table_columns.where(:title => sheet[0].cells[i].value.to_s.split("-").first.strip).first : table.table_columns.where(:key => c.value.to_s).first
}
languages = sheet[2].cells.collect{|c|
c.value.split("-").last rescue nil