質問編集履歴
3
アップデート部分のソースコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -216,6 +216,40 @@
|
|
216
216
|
|
217
217
|
```
|
218
218
|
|
219
|
+
|
220
|
+
|
221
|
+
###アップデートに関する部分のソースコード
|
222
|
+
|
223
|
+
####index.js
|
224
|
+
|
225
|
+
```
|
226
|
+
|
227
|
+
self.updateList = function() {
|
228
|
+
|
229
|
+
openLoadingModal();
|
230
|
+
|
231
|
+
$.getJSON( "/car-maintenance/MtCarAppliances/search", function( data ) {
|
232
|
+
|
233
|
+
if (data.success) {
|
234
|
+
|
235
|
+
data.data = addEventToArray(data);
|
236
|
+
|
237
|
+
self.carappliances( data.data);
|
238
|
+
|
239
|
+
} else {
|
240
|
+
|
241
|
+
openDialog('.dialog', 'データ取得に失敗しました。', 'warn');
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
closeLoadingModal();
|
246
|
+
|
247
|
+
});
|
248
|
+
|
249
|
+
};
|
250
|
+
|
251
|
+
```
|
252
|
+
|
219
253
|
###テーブルの構造
|
220
254
|
|
221
255
|
|
2
テーブルの構造とログの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,23 +14,37 @@
|
|
14
14
|
|
15
15
|
```
|
16
16
|
|
17
|
+
if ($this->request->is('get')) {
|
18
|
+
|
19
|
+
|
20
|
+
|
17
|
-
$
|
21
|
+
$carappliances = $this->carappliances();
|
18
|
-
|
22
|
+
|
19
|
-
$new_order_no = 1;
|
23
|
+
$new_order_no = 1;
|
20
|
-
|
24
|
+
|
25
|
+
|
26
|
+
|
21
|
-
foreach ($
|
27
|
+
foreach ($aarcppliances as $key => $value){
|
22
|
-
|
28
|
+
|
23
|
-
$
|
29
|
+
$aarcppliances[$key]["MtAarCppliance"]["order_no"] = $new_order_no;
|
24
|
-
|
30
|
+
|
25
|
-
$new_order_no = $new_order_no + 1;
|
31
|
+
$new_order_no = $new_order_no + 1;
|
26
|
-
|
27
|
-
|
32
|
+
|
28
|
-
|
29
|
-
}
|
33
|
+
}
|
34
|
+
|
30
|
-
|
35
|
+
$this->log($aarcppliances);
|
36
|
+
|
31
|
-
|
37
|
+
return json_encode(['success' => 'success', 'data' => $aarcppliances ]);
|
38
|
+
|
32
|
-
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
private function carappliances() {
|
44
|
+
|
45
|
+
$mtCarApplianceData = $this->MtCarAppliance->find('all', ['order' => 'order_no']);
|
46
|
+
|
33
|
-
return $mt
|
47
|
+
return $mtCarApplianceData;
|
34
48
|
|
35
49
|
}
|
36
50
|
|
@@ -38,6 +52,196 @@
|
|
38
52
|
|
39
53
|
|
40
54
|
|
55
|
+
###エラーログ
|
56
|
+
|
57
|
+
編集した際に出たログです。
|
58
|
+
|
59
|
+
```
|
60
|
+
|
61
|
+
(
|
62
|
+
|
63
|
+
[0] => Array
|
64
|
+
|
65
|
+
(
|
66
|
+
|
67
|
+
[MtAarCppliance] => Array
|
68
|
+
|
69
|
+
(
|
70
|
+
|
71
|
+
[id] => 1
|
72
|
+
|
73
|
+
[name] => あ
|
74
|
+
|
75
|
+
[order_no] => 1
|
76
|
+
|
77
|
+
[created_user] => 1
|
78
|
+
|
79
|
+
[created_datetime] => 2018-08-08 00:00:00
|
80
|
+
|
81
|
+
[modified_user] => 28
|
82
|
+
|
83
|
+
[modified_datetime] => 2019-12-20 12:58:33
|
84
|
+
|
85
|
+
)
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
)
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
[1] => Array
|
94
|
+
|
95
|
+
(
|
96
|
+
|
97
|
+
[MtAarCppliance] => Array
|
98
|
+
|
99
|
+
(
|
100
|
+
|
101
|
+
[id] => 11
|
102
|
+
|
103
|
+
[name] => い
|
104
|
+
|
105
|
+
[order_no] => 2
|
106
|
+
|
107
|
+
[created_user] => 28
|
108
|
+
|
109
|
+
[created_datetime] => 2019-12-20 10:30:41
|
110
|
+
|
111
|
+
[modified_user] => 28
|
112
|
+
|
113
|
+
[modified_datetime] => 2019-12-20 12:58:38
|
114
|
+
|
115
|
+
)
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
)
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
[2] => Array
|
124
|
+
|
125
|
+
(
|
126
|
+
|
127
|
+
[MtAarCppliance] => Array
|
128
|
+
|
129
|
+
(
|
130
|
+
|
131
|
+
[id] => 12
|
132
|
+
|
133
|
+
[name] => お
|
134
|
+
|
135
|
+
[order_no] => 3
|
136
|
+
|
137
|
+
[created_user] => 28
|
138
|
+
|
139
|
+
[created_datetime] => 2019-12-20 11:56:11
|
140
|
+
|
141
|
+
[modified_user] => 28
|
142
|
+
|
143
|
+
[modified_datetime] => 2019-12-20 12:58:55
|
144
|
+
|
145
|
+
)
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
)
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
[3] => Array
|
154
|
+
|
155
|
+
(
|
156
|
+
|
157
|
+
[MtAarCppliance] => Array
|
158
|
+
|
159
|
+
(
|
160
|
+
|
161
|
+
[id] => 10
|
162
|
+
|
163
|
+
[name] => う
|
164
|
+
|
165
|
+
[order_no] => 4
|
166
|
+
|
167
|
+
[created_user] => 28
|
168
|
+
|
169
|
+
[created_datetime] => 2019-12-20 09:24:02
|
170
|
+
|
171
|
+
[modified_user] => 28
|
172
|
+
|
173
|
+
[modified_datetime] => 2019-12-20 13:00:31
|
174
|
+
|
175
|
+
)
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
)
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
[4] => Array
|
184
|
+
|
185
|
+
(
|
186
|
+
|
187
|
+
[MtAarCppliance] => Array
|
188
|
+
|
189
|
+
(
|
190
|
+
|
191
|
+
[id] => 13
|
192
|
+
|
193
|
+
[name] => え
|
194
|
+
|
195
|
+
[order_no] => 5
|
196
|
+
|
197
|
+
[created_user] => 28
|
198
|
+
|
199
|
+
[created_datetime] => 2019-12-20 11:56:18
|
200
|
+
|
201
|
+
[modified_user] => 28
|
202
|
+
|
203
|
+
[modified_datetime] => 2019-12-20 13:04:48
|
204
|
+
|
205
|
+
)
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
)
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
)
|
214
|
+
|
215
|
+
同じものがもう一つありました。
|
216
|
+
|
217
|
+
```
|
218
|
+
|
219
|
+
###テーブルの構造
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
論理名 物理名 データ型
|
224
|
+
|
225
|
+
設備名 name varchar
|
226
|
+
|
227
|
+
表示順 order_no integer
|
228
|
+
|
229
|
+
登録者 created_user integer
|
230
|
+
|
231
|
+
登録日時 created_datetime timestamp
|
232
|
+
|
233
|
+
更新者 modified_user integer
|
234
|
+
|
235
|
+
更新日時 modified_datetime timestamp
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
実際に画面に表示しているものは設備名と表示順だけです。
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
41
245
|
### 発生している問題・エラーメッセージ
|
42
246
|
|
43
247
|
|
1
補足情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
### 補足情報(FW/ツールのバージョンなど)
|
70
70
|
|
71
|
-
|
71
|
+
足りない情報などがありましたら、コメントで教えていただけるとありがたいです。
|
72
72
|
|
73
73
|
この機能を追加する前の状態は以下のような感じでした。
|
74
74
|
|