- 일별 출면일보 마스터 + 인원/장비 3테이블 마이그레이션 - 캘린더 스트립 (1~31일) 날짜 선택 및 상태 닷 표시 - 인원/장비 탭 CRUD (추가/수정/삭제/번개 랜덤데이터) - 검토자 확인 모달 (조직도 + 검색 + 검토라인) - 양식보기 모달 (출면일보/장비일보 인쇄 양식) - 날씨/특이사항/상태 업데이트 API
45 lines
976 B
PHP
45 lines
976 B
PHP
<?php
|
|
|
|
namespace App\Models\Juil;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class PmisDailyAttendance extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'pmis_daily_attendances';
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'date',
|
|
'company_name',
|
|
'weather',
|
|
'status',
|
|
'notes',
|
|
'options',
|
|
];
|
|
|
|
protected $casts = [
|
|
'date' => 'date',
|
|
'options' => 'array',
|
|
];
|
|
|
|
public function scopeTenant($query, $tenantId)
|
|
{
|
|
return $query->where('tenant_id', $tenantId);
|
|
}
|
|
|
|
public function workers(): HasMany
|
|
{
|
|
return $this->hasMany(PmisAttendanceWorker::class, 'attendance_id')->orderBy('sort_order');
|
|
}
|
|
|
|
public function equipments(): HasMany
|
|
{
|
|
return $this->hasMany(PmisAttendanceEquipment::class, 'attendance_id')->orderBy('sort_order');
|
|
}
|
|
}
|