質問編集履歴
1
コード修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -46,47 +46,28 @@
|
|
46
46
|
|
47
47
|
if params[:manage_id].present?
|
48
48
|
items = GyomuDatum.where('manage_id LIKE ?', "%#{params[:manage_id]}%")
|
49
|
-
pp "manage_id_debug"
|
50
|
-
pp items
|
51
49
|
elsif params[:category_id].present?
|
52
50
|
items = GyomuDatum.where('category_id LIKE ?', "%#{params[:category_id]}%")
|
53
|
-
pp "category_id_debug"
|
54
|
-
pp items
|
55
51
|
elsif params[:publish_corporation].present?
|
56
52
|
items = GyomuDatum.where('publish_corporation LIKE ?', "%#{params[:publish_corporation]}%")
|
57
|
-
pp "publish_corporation_debug"
|
58
|
-
pp items
|
59
|
-
pp items
|
60
53
|
elsif params[:ip_address].present?
|
61
54
|
items = GyomuDatum.where('ip_address LIKE ?', "%#{params[:ip_address]}%")
|
62
|
-
pp "ip_address_debug"
|
63
|
-
pp items
|
64
55
|
elsif params[:target_server].present?
|
65
56
|
items = GyomuDatum.where('target_server LIKE ?', "%#{params[:target_server]}%")
|
66
|
-
pp "target_server_debug"
|
67
|
-
pp items
|
68
57
|
elsif params[:start_date].present?
|
69
58
|
items = GyomuDatum.where('start_date LIKE ?', "%#{params[:start_date]}%")
|
70
|
-
pp "start_date_debug"
|
71
|
-
pp items
|
72
59
|
elsif params[:end_date].present?
|
73
60
|
items = GyomuDatum.where('end_date LIKE ?', "%#{params[:end_date]}%")
|
74
|
-
pp "end_date_debug"
|
75
|
-
pp items
|
76
61
|
elsif params[:comment].present?
|
77
62
|
items = GyomuDatum.where('comment LIKE ?', "%#{params[:comment]}%")
|
78
|
-
|
63
|
+
|
79
|
-
pp items
|
80
64
|
else
|
81
65
|
items = GyomuDatum.all.order(created_at: 'desc')
|
82
|
-
|
66
|
+
|
83
|
-
pp items
|
84
67
|
end
|
68
|
+
|
85
69
|
|
86
|
-
pp "elseout"
|
87
|
-
pp items
|
88
70
|
|
89
|
-
|
90
71
|
|
91
72
|
pp "############データ検索終了############"
|
92
73
|
|
@@ -100,15 +81,6 @@
|
|
100
81
|
to = (from + 1.month)
|
101
82
|
@items_1month = GyomuDatum.where(end_date: from...to)
|
102
83
|
|
103
|
-
# レコード数カウント
|
104
|
-
#record = GyomuDatum.count
|
105
|
-
#record = GyomuDatum.group(:created_at).count(:created_at)
|
106
|
-
#record = select count(*) as cnt from GyomuDatum where created_at = 201806*;
|
107
|
-
record = GyomuDatum.group(:category_id).count
|
108
|
-
|
109
|
-
pp "レコード数表示"
|
110
|
-
pp record
|
111
|
-
|
112
84
|
end
|
113
85
|
|
114
86
|
def show
|
@@ -135,8 +107,6 @@
|
|
135
107
|
histories = HistoriesDatum.new({manage_id: manage_id, category_id: category_id, type_id: '1', user_id: session[:user_id], user_name: session[:user_name], created_at: time, updated_at: time, deleted_at: ""})
|
136
108
|
histories.save
|
137
109
|
|
138
|
-
|
139
|
-
# @item = GyomuDatum.new(item_params)
|
140
110
|
|
141
111
|
# データ登録判定
|
142
112
|
|