完善接口和后台页面
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\library\finance\WithdrawFlow;
|
||||
use app\common\model\UserWalletRecord;
|
||||
use Webman\Http\Request;
|
||||
use support\Response;
|
||||
@@ -17,12 +18,30 @@ class Wallet extends MobileBase
|
||||
return $response;
|
||||
}
|
||||
$user = $this->auth->getUser();
|
||||
$coinBalance = WithdrawFlow::amountString($user->coin ?? '0');
|
||||
$flow = WithdrawFlow::status(intval($user->id), [
|
||||
'total_deposit_coin' => $user->total_deposit_coin ?? '0',
|
||||
'total_withdraw_coin' => $user->total_withdraw_coin ?? '0',
|
||||
'bet_flow_coin' => $user->bet_flow_coin ?? '0',
|
||||
]);
|
||||
$maxWithdrawable = WithdrawFlow::maxWithdrawable($coinBalance, $flow);
|
||||
return $this->mobileSuccess([
|
||||
'coin_balance' => $user->coin,
|
||||
'frozen_balance' => '0.0000',
|
||||
'total_deposit_coin' => $user->total_deposit_coin ?? '0.0000',
|
||||
'total_valid_bet_coin' => $user->total_valid_bet_coin ?? '0.0000',
|
||||
'withdrawable_balance' => $user->coin,
|
||||
'coin_balance' => $coinBalance,
|
||||
'frozen_balance' => '0.0000',
|
||||
'withdrawable_balance' => $coinBalance,
|
||||
'max_withdrawable' => $maxWithdrawable,
|
||||
'total_deposit_coin' => WithdrawFlow::amountString($user->total_deposit_coin ?? '0'),
|
||||
'total_withdraw_coin' => WithdrawFlow::amountString($user->total_withdraw_coin ?? '0'),
|
||||
'bet_flow_coin' => $flow['bet_flow_coin'],
|
||||
'withdraw_flow' => [
|
||||
'ratio' => $flow['ratio'],
|
||||
'net_deposit' => $flow['net_deposit'],
|
||||
'required_bet_flow' => $flow['required_bet_flow'],
|
||||
'remaining_bet_flow' => $flow['remaining_bet_flow'],
|
||||
'eligible' => $flow['eligible'],
|
||||
'max_withdraw_by_flow' => $flow['flow_unlimited'] ? null : $flow['max_withdraw_by_flow'],
|
||||
'flow_unlimited' => $flow['flow_unlimited'],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -32,9 +51,9 @@ class Wallet extends MobileBase
|
||||
if ($response !== null) {
|
||||
return $response;
|
||||
}
|
||||
$type = trim((string) $request->get('type', 'all'));
|
||||
$page = $this->intValue($request->get('page', 1), 1);
|
||||
$pageSize = $this->intValue($request->get('page_size', 20), 20);
|
||||
$type = trim((string) $request->input('type', 'all'));
|
||||
$page = $this->intValue($request->input('page', 1), 1);
|
||||
$pageSize = $this->intValue($request->input('page_size', 20), 20);
|
||||
|
||||
$query = UserWalletRecord::where('user_id', $this->auth->id)->order('id', 'desc');
|
||||
if ($type !== '' && $type !== 'all') {
|
||||
|
||||
Reference in New Issue
Block a user