feat: [pmis] PMIS 자료실/안전관리/품질관리 기능 추가 및 개선
- 자료실 하위 3개 메뉴: 자료보관함, 매뉴얼, 공지사항 - 자료보관함: 폴더 트리 + 파일 업로드/다운로드/삭제 - 매뉴얼/공지사항: 게시판형 CRUD + 첨부파일 - 안전관리: 안전보건교육, TBM현황, 위험성평가, 재해예방조치 - 품질관리: 시정조치 UI 페이지 - 대시보드: 슈퍼관리자 전용 레거시 사이트 참고 카드 - 작업일보/출면일보 오류 수정 및 기능 개선 - 설비 사진 업로드, 근로계약서 종료일 수정
This commit is contained in:
@@ -22,7 +22,7 @@ private function tenantId(): int
|
||||
public function show(Request $request): JsonResponse
|
||||
{
|
||||
$date = $request->input('date', now()->toDateString());
|
||||
$company = $request->input('company', '');
|
||||
$company = $request->input('company') ?? '';
|
||||
|
||||
$report = PmisDailyWorkReport::tenant($this->tenantId())
|
||||
->where('date', $date)
|
||||
@@ -48,7 +48,7 @@ public function monthStatus(Request $request): JsonResponse
|
||||
{
|
||||
$year = $request->integer('year', now()->year);
|
||||
$month = $request->integer('month', now()->month);
|
||||
$company = $request->input('company', '');
|
||||
$company = $request->input('company') ?? '';
|
||||
|
||||
$reports = PmisDailyWorkReport::tenant($this->tenantId())
|
||||
->whereYear('date', $year)
|
||||
@@ -91,7 +91,15 @@ public function update(Request $request, int $id): JsonResponse
|
||||
'options' => 'sometimes|nullable|array',
|
||||
]);
|
||||
|
||||
// NOT NULL string 컬럼의 null → 빈 문자열 변환
|
||||
foreach (['fine_dust', 'ultra_fine_dust', 'weather'] as $col) {
|
||||
if (array_key_exists($col, $validated) && $validated[$col] === null) {
|
||||
$validated[$col] = '';
|
||||
}
|
||||
}
|
||||
|
||||
$report->update($validated);
|
||||
$report->load(['workers', 'equipments', 'materials', 'volumes', 'photos']);
|
||||
|
||||
return response()->json($report);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user