質問編集履歴

6

ソースコードを追加いたしました。

2020/06/08 20:54

投稿

pond
pond

スコア350

test CHANGED
File without changes
test CHANGED
@@ -154,7 +154,11 @@
154
154
 
155
155
 
156
156
 
157
+ ```
158
+
159
+
160
+
157
- ```PHP
161
+ ```php
158
162
 
159
163
  # 処理概要の図のExportJsonCommand.php
160
164
 

5

ソースコードを追加いたしました。

2020/06/08 20:54

投稿

pond
pond

スコア350

test CHANGED
File without changes
test CHANGED
@@ -154,10 +154,154 @@
154
154
 
155
155
 
156
156
 
157
+ ```PHP
158
+
159
+ # 処理概要の図のExportJsonCommand.php
160
+
161
+ <?php
162
+
163
+
164
+
165
+ namespace App\Console\Commands;
166
+
167
+
168
+
169
+ use Illuminate\Console\Command;
170
+
171
+ use Illuminate\Http\Request;
172
+
173
+ use App\Models\Contents;
174
+
175
+ use Carbon\Carbon;
176
+
177
+ use DB;
178
+
179
+
180
+
181
+ use App\Http\Controllers\HomeController;
182
+
183
+
184
+
185
+ use Monolog\Logger;
186
+
187
+ use Monolog\Formatter\LineFormatter;
188
+
189
+ use Monolog\Handler\StreamHandler; // one file logging
190
+
191
+ use Monolog\Handler\RotatingFileHandler; //dairy file rotating logging
192
+
193
+
194
+
195
+ /**
196
+
197
+ * JSON出力処理
198
+
199
+ *
200
+
201
+ */
202
+
203
+ class ExportJsonCommand extends Command
204
+
205
+ {
206
+
207
+ protected $description = 'DBからJSONデータを出力します';
208
+
209
+
210
+
211
+ protected $signature = 'command:export_json';
212
+
213
+ protected $logger;
214
+
215
+ protected $formatter;
216
+
217
+
218
+
219
+ /**
220
+
221
+ * Create a new command instance.
222
+
223
+ *
224
+
225
+ * @return void
226
+
227
+ */
228
+
229
+ public function __construct()
230
+
231
+ {
232
+
233
+ parent::__construct();
234
+
235
+
236
+
237
+ $logFile = 'logs/batch.log';
238
+
239
+
240
+
241
+ $this->logger = new Logger($this->signature);
242
+
243
+ $formatter = new LineFormatter(null, null, false, true);
244
+
245
+ $infoHandler = new StreamHandler(storage_path() ."/". $logFile, Logger::DEBUG);
246
+
247
+ $infoHandler->setFormatter($formatter);
248
+
249
+ $this->logger->pushHandler($infoHandler);
250
+
251
+ }
252
+
253
+
254
+
255
+ /**
256
+
257
+ * Execute the console command.
258
+
259
+ *
260
+
261
+ * @return mixed
262
+
263
+ */
264
+
265
+ public function handle(Request $request)
266
+
267
+ {
268
+
269
+ $dt = new Carbon;
270
+
271
+
272
+
273
+ # ログ出力用文字列
274
+
275
+ $log_body = "".$dt->format('H:i:s')."~ ";
276
+
277
+
278
+
279
+ $home = new HomeController;
280
+
281
+ $res = $home->outputJSON();
282
+
283
+ $log_body.= "***END:".$dt->format('H:i:s');
284
+
285
+
286
+
287
+ # バッチ処理終了ログ出力
288
+
289
+ $this->logger->info($log_body);
290
+
291
+ }
292
+
293
+
294
+
295
+
296
+
297
+ }
298
+
157
299
  ```
158
300
 
159
301
 
160
302
 
303
+
304
+
161
305
  ### アプリの処理概要
162
306
 
163
307
  ![イメージ説明](dd9b8e0090c8c39ee4486658fb1c542b.png)

4

情報を追加いたしました。

2020/06/08 20:53

投稿

pond
pond

スコア350

test CHANGED
File without changes
test CHANGED
@@ -45,6 +45,8 @@
45
45
 
46
46
 
47
47
  ```sql
48
+
49
+ # 処理概要の図のContents.phpの一部
48
50
 
49
51
  # JSON出力する項目
50
52
 

3

添付画像を修正いたしました。

2020/06/08 20:46

投稿

pond
pond

スコア350

test CHANGED
File without changes
test CHANGED
@@ -158,7 +158,7 @@
158
158
 
159
159
  ### アプリの処理概要
160
160
 
161
- ![イメージ説明](b4b0c81b7bc0a8f3e207a9788dbf0782.png)
161
+ ![イメージ説明](dd9b8e0090c8c39ee4486658fb1c542b.png)
162
162
 
163
163
 
164
164
 

2

アプリの処理概要を追加いたしました。

2020/06/08 20:42

投稿

pond
pond

スコア350

test CHANGED
File without changes
test CHANGED
@@ -156,6 +156,12 @@
156
156
 
157
157
 
158
158
 
159
+ ### アプリの処理概要
160
+
161
+ ![イメージ説明](b4b0c81b7bc0a8f3e207a9788dbf0782.png)
162
+
163
+
164
+
159
165
  ### テーブル構造
160
166
 
161
167
  ![イメージ説明](755cf7dddd8e0d1fbd15d6dee00a1da2.png)

1

テーブル構造を追加いたしました。

2020/06/08 20:39

投稿

pond
pond

スコア350

test CHANGED
File without changes
test CHANGED
@@ -156,6 +156,14 @@
156
156
 
157
157
 
158
158
 
159
+ ### テーブル構造
160
+
161
+ ![イメージ説明](755cf7dddd8e0d1fbd15d6dee00a1da2.png)
162
+
163
+
164
+
165
+
166
+
159
167
 
160
168
 
161
169
  ### 補足情報(FW/ツールのバージョンなど)