feat: [HR/기타] 캘린더/배차/설비/재고 + DB 마이그레이션
- 캘린더 CRUD API, 배차차량 관리 API (CRUD + options) - 배차정보 다중 행 시스템 (shipment_vehicle_dispatches) - 설비 다중점검주기 + 부 담당자 스키마 추가 - TodayIssue 날짜 기반 조회, Stock/Client 날짜 필터 - i18n 메시지 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -88,6 +88,20 @@ public function index(array $params): LengthAwarePaginator
|
||||
});
|
||||
}
|
||||
|
||||
// 날짜 범위 필터 (해당 기간에 입출고 이력이 있는 품목만)
|
||||
if (! empty($params['start_date']) || ! empty($params['end_date'])) {
|
||||
$query->whereHas('stock', function ($stockQuery) use ($params) {
|
||||
$stockQuery->whereHas('transactions', function ($txQuery) use ($params) {
|
||||
if (! empty($params['start_date'])) {
|
||||
$txQuery->whereDate('created_at', '>=', $params['start_date']);
|
||||
}
|
||||
if (! empty($params['end_date'])) {
|
||||
$txQuery->whereDate('created_at', '<=', $params['end_date']);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 정렬
|
||||
$sortBy = $params['sort_by'] ?? 'code';
|
||||
$sortDir = $params['sort_dir'] ?? 'asc';
|
||||
|
||||
Reference in New Issue
Block a user