clean up wallet

This commit is contained in:
omair saleh
2022-02-10 10:50:17 +08:00
parent 1585dcfa5a
commit cee0f99dc9
3 changed files with 109 additions and 37 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ class WalletResource extends JsonResource
'amount' => (double) $this->amount,
'company_id' => (int) $this->owner->id,
'transactions' => WalletTransactionResource::collection($this->transactions()->whereIn('status', [2, 3])->orderBy('id', 'DESC')->get()),
'top_up_records' => WalletTransactionResource::collection($this->transactions()->where('type', TransactionType::TOP_UP)->orderBy('id', 'DESC')->get())
'top_up_records' => WalletTransactionResource::collection($this->transactions()->whereNotIn('status', [0])->where('type', TransactionType::TOP_UP)->orderBy('id', 'DESC')->get())
];
}
}