fix: 입고 목록 날짜 필터 기준을 created_at으로 변경
- receiving_date 기준 → created_at(작성일) 기준으로 변경 - 입고처리 전(receiving_date=NULL) 데이터가 필터에서 누락되는 문제 해결 - creator 관계 eager loading 추가 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ public function index(array $params): LengthAwarePaginator
|
||||
$tenantId = $this->tenantId();
|
||||
|
||||
$query = Receiving::query()
|
||||
->with('creator:id,name')
|
||||
->where('tenant_id', $tenantId);
|
||||
|
||||
// 검색어 필터
|
||||
@@ -41,12 +42,12 @@ public function index(array $params): LengthAwarePaginator
|
||||
}
|
||||
}
|
||||
|
||||
// 날짜 범위 필터
|
||||
// 날짜 범위 필터 (작성일 기준)
|
||||
if (! empty($params['start_date'])) {
|
||||
$query->where('receiving_date', '>=', $params['start_date']);
|
||||
$query->whereDate('created_at', '>=', $params['start_date']);
|
||||
}
|
||||
if (! empty($params['end_date'])) {
|
||||
$query->where('receiving_date', '<=', $params['end_date']);
|
||||
$query->whereDate('created_at', '<=', $params['end_date']);
|
||||
}
|
||||
|
||||
// 정렬
|
||||
|
||||
Reference in New Issue
Block a user