fix: [finance] 일반전표 목록 source 필드 및 페이지네이션 구조 수정
- deposits/withdrawals 조회 시 source를 항상 'linked'로 고정 - 페이지네이션 meta 래핑 제거하여 플랫 구조로 변경 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,7 @@ public function index(array $params): array
|
||||
DB::raw('0 as withdrawal_amount'),
|
||||
DB::raw('COALESCE(journal_entries.total_debit, 0) as debit_amount'),
|
||||
DB::raw('COALESCE(journal_entries.total_credit, 0) as credit_amount'),
|
||||
DB::raw("CASE WHEN journal_entries.id IS NOT NULL THEN 'linked' ELSE 'manual' END as source"),
|
||||
DB::raw("'linked' as source"),
|
||||
'deposits.created_at',
|
||||
'deposits.updated_at',
|
||||
DB::raw('journal_entries.id as journal_entry_id'),
|
||||
@@ -73,7 +73,7 @@ public function index(array $params): array
|
||||
'withdrawals.amount as withdrawal_amount',
|
||||
DB::raw('COALESCE(journal_entries.total_debit, 0) as debit_amount'),
|
||||
DB::raw('COALESCE(journal_entries.total_credit, 0) as credit_amount'),
|
||||
DB::raw("CASE WHEN journal_entries.id IS NOT NULL THEN 'linked' ELSE 'manual' END as source"),
|
||||
DB::raw("'linked' as source"),
|
||||
'withdrawals.created_at',
|
||||
'withdrawals.updated_at',
|
||||
DB::raw('journal_entries.id as journal_entry_id'),
|
||||
@@ -170,12 +170,10 @@ public function index(array $params): array
|
||||
|
||||
return [
|
||||
'data' => $items->toArray(),
|
||||
'meta' => [
|
||||
'current_page' => $page,
|
||||
'last_page' => (int) ceil($totalCount / $perPage),
|
||||
'per_page' => $perPage,
|
||||
'total' => $totalCount,
|
||||
],
|
||||
'current_page' => $page,
|
||||
'last_page' => (int) ceil($totalCount / $perPage),
|
||||
'per_page' => $perPage,
|
||||
'total' => $totalCount,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user