Andrew Wallo 5 月之前
父節點
當前提交
420ded8387
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      app/Services/AccountService.php

+ 1
- 1
app/Services/AccountService.php 查看文件

@@ -123,7 +123,7 @@ class AccountService
123 123
                 'journal_entries.type',
124 124
                 'journal_entries.amount',
125 125
                 'journal_entries.description',
126
-                DB::raw('journal_entries.amount * IF(journal_entries.type = "debit", 1, -1) AS signed_amount')
126
+                DB::raw("journal_entries.amount * CASE WHEN journal_entries.type = 'debit' THEN 1 ELSE -1 END AS signed_amount")
127 127
             )
128 128
                 ->whereBetween('transactions.posted_at', [$startDate, $endDate])
129 129
                 ->join('transactions', 'transactions.id', '=', 'journal_entries.transaction_id')

Loading…
取消
儲存