Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/WalletsController.php
Show First 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | public function transactions($id) | ||||
->get(); | ->get(); | ||||
if (count($result) > $pageSize) { | if (count($result) > $pageSize) { | ||||
$result->pop(); | $result->pop(); | ||||
$hasMore = true; | $hasMore = true; | ||||
} | } | ||||
} | } | ||||
$result = $result->map(function ($item) use ($isAdmin) { | $result = $result->map(function ($item) use ($isAdmin, $wallet) { | ||||
$entry = [ | $entry = [ | ||||
'id' => $item->id, | 'id' => $item->id, | ||||
'createdAt' => $item->created_at->format('Y-m-d H:i'), | 'createdAt' => $item->created_at->format('Y-m-d H:i'), | ||||
'type' => $item->type, | 'type' => $item->type, | ||||
'description' => $item->shortDescription(), | 'description' => $item->shortDescription(), | ||||
'amount' => $item->amount, | 'amount' => $item->amount, | ||||
'currency' => $wallet->currency, | |||||
'hasDetails' => !empty($item->cnt), | 'hasDetails' => !empty($item->cnt), | ||||
]; | ]; | ||||
if ($isAdmin && $item->user_email) { | if ($isAdmin && $item->user_email) { | ||||
$entry['user'] = $item->user_email; | $entry['user'] = $item->user_email; | ||||
} | } | ||||
return $entry; | return $entry; | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |