导入数据时多个“|”

This commit is contained in:
cxt 2018-06-05 15:57:48 +08:00
parent 927158fbae
commit f69a12d6e7
1 changed files with 1 additions and 1 deletions

View File

@ -97,7 +97,7 @@ class StatisticsController < ApplicationController
# logger.info("data-list-------------#{data_list}")
l_index = description.index("|").to_i
r_index= description.rindex("|").to_i - 1
r_index= description.rindex("|").to_i
description = description.sub(description[l_index..r_index], data_list)
Statistic.create(:description => description, :name => list[0], :status => exp_statistic.status, :user_id => 21502, :main_category_id => exp_statistic.main_category_id, :sub_category_id => exp_statistic.sub_category_id, :file_size => file_size)