|
@@ -110,18 +110,24 @@ class Withdraw extends Controller
|
|
|
->orderByRaw('CASE WHEN status = 0 THEN 0 ELSE 1 END')
|
|
->orderByRaw('CASE WHEN status = 0 THEN 0 ELSE 1 END')
|
|
|
->orderByDesc('created_at')
|
|
->orderByDesc('created_at')
|
|
|
->forpage($page, $limit)->get();
|
|
->forpage($page, $limit)->get();
|
|
|
|
|
+ $totalAmount = 0;
|
|
|
|
|
+ $totalSuccess = 0;
|
|
|
|
|
+ $totalFail = 0;
|
|
|
foreach ($list as &$item) {
|
|
foreach ($list as &$item) {
|
|
|
$item['exchange_rate'] = floatval($item['exchange_rate']);
|
|
$item['exchange_rate'] = floatval($item['exchange_rate']);
|
|
|
$item['after_balance'] = floatval($item['after_balance']);
|
|
$item['after_balance'] = floatval($item['after_balance']);
|
|
|
$item['service_charge'] = floatval($item['service_charge']);
|
|
$item['service_charge'] = floatval($item['service_charge']);
|
|
|
$item['amount'] = floatval($item['amount']);
|
|
$item['amount'] = floatval($item['amount']);
|
|
|
- $item['to_account'] = floatval($item['to_account']);
|
|
|
|
|
|
|
+ if ($item['status'] == 1) $totalSuccess += $item['amount'];
|
|
|
|
|
+ if ($item['status'] == 2) $totalFail += $item['amount'];
|
|
|
|
|
+ $totalAmount += $item['amount'];
|
|
|
|
|
+ $item['to_account_usdt'] = $item['to_account'] = floatval($item['to_account']);
|
|
|
$item['exchange_rate'] = $item['exchange_rate'] <= 0 ? 7.3 : $item['exchange_rate'];
|
|
$item['exchange_rate'] = $item['exchange_rate'] <= 0 ? 7.3 : $item['exchange_rate'];
|
|
|
- $item['to_account_usdt'] = floatval($item['to_account']);
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- $result = ['total' => $count, 'data' => $list];
|
|
|
|
|
|
|
+ $result = ['total' => $count, 'total_fail' => $totalFail, 'total_success' => $totalSuccess, 'total_amount' => $totalAmount, 'data' => $list];
|
|
|
} catch (ValidationException $e) {
|
|
} catch (ValidationException $e) {
|
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first());
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|