浏览代码

Merge pull request #83 from andrewdwallo/fix/group-by-error

fix #82
3.x
Andrew Wallo 1年前
父节点
当前提交
2352c1416f
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 18 次插入2 次删除
  1. 18
    2
      app/Services/AccountService.php

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

170
                 $join->on('transactions.id', '=', 'journal_entries.transaction_id')
170
                 $join->on('transactions.id', '=', 'journal_entries.transaction_id')
171
                     ->where('transactions.posted_at', '<=', $endDate);
171
                     ->where('transactions.posted_at', '<=', $endDate);
172
             })
172
             })
173
-            ->groupBy('accounts.id')
173
+            ->groupBy([
174
+                'accounts.id',
175
+                'accounts.name',
176
+                'accounts.category',
177
+                'accounts.type',
178
+                'accounts.subtype_id',
179
+                'accounts.currency_code',
180
+                'accounts.code',
181
+            ])
174
             ->with(['subtype:id,name,inverse_cash_flow']);
182
             ->with(['subtype:id,name,inverse_cash_flow']);
175
 
183
 
176
         if (! empty($accountIds)) {
184
         if (! empty($accountIds)) {
230
                     ->whereNotNull('bank_accounts.bank_account_id')
238
                     ->whereNotNull('bank_accounts.bank_account_id')
231
                     ->whereColumn('je.transaction_id', 'journal_entries.transaction_id');
239
                     ->whereColumn('je.transaction_id', 'journal_entries.transaction_id');
232
             })
240
             })
233
-            ->groupBy('accounts.id')
241
+            ->groupBy([
242
+                'accounts.id',
243
+                'accounts.name',
244
+                'accounts.category',
245
+                'accounts.type',
246
+                'accounts.subtype_id',
247
+                'accounts.currency_code',
248
+                'accounts.code',
249
+            ])
234
             ->with(['subtype:id,name,inverse_cash_flow']);
250
             ->with(['subtype:id,name,inverse_cash_flow']);
235
 
251
 
236
         if (! empty($accountIds)) {
252
         if (! empty($accountIds)) {

正在加载...
取消
保存