This commit is contained in:
aozhiwei 2022-03-28 20:09:14 +08:00
parent 354dfb34d0
commit 268a3713d6
2 changed files with 6 additions and 6 deletions

View File

@ -31,7 +31,7 @@ class WalletController extends BaseController {
$netId = getReqVal('net_id', ''); $netId = getReqVal('net_id', '');
$amount = getReqVal('amount', ''); $amount = getReqVal('amount', '');
$times = Withdrawal::getTodayWithdrawalTimes($account); $times = Withdrawal::getTodayWithdrawalTimes($account);
if ($times) { if ($times > 200) {
myself()->_rspErr(1, 'More withdrawals than today'); myself()->_rspErr(1, 'More withdrawals than today');
return; return;
} }
@ -40,7 +40,7 @@ class WalletController extends BaseController {
'seq_id' => $seqId 'seq_id' => $seqId
)); ));
if ($this->isTestMode()) { if ($this->isTestMode()) {
Withdrawal::testOk($seqid, $account, $type, $netId, $amount); Withdrawal::testOk($seqId, $account, $type, $netId, $amount);
} }
} }

View File

@ -13,7 +13,7 @@ class Withdrawal extends BaseModel {
public static function getTodayWithdrawalTimes($account) public static function getTodayWithdrawalTimes($account)
{ {
$row = myself()->_getMarketMysql()->execQueryOne( $row = myself()->_getMarketMysql()->execQueryOne(
'SELECT COUNT(1) AS times FROM t_withdrawal WHERE account=:account AND createtime>=:now_dayseconds AND createtime:<=:now_dayseconds + 3600 * 24;', 'SELECT COUNT(1) AS times FROM t_withdrawal WHERE account=:account AND createtime>=:now_dayseconds AND createtime<=:now_dayseconds + 3600 * 24;',
array( array(
':account' => $account, ':account' => $account,
':now_dayseconds' => myself()->_getNowDaySeconds() ':now_dayseconds' => myself()->_getNowDaySeconds()
@ -40,10 +40,10 @@ class Withdrawal extends BaseModel {
return $seqId; return $seqId;
} }
public static function get($seqId) public static function find($seqId)
{ {
$row = SqlHelper::ormSelectOne( $row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(), myself()->_getMarketMysql(),
't_withdrawal', 't_withdrawal',
array( array(
'idx' => $seqId, 'idx' => $seqId,
@ -55,7 +55,7 @@ class Withdrawal extends BaseModel {
public static function testOk($idx, $account, $type, $netId, $amount) public static function testOk($idx, $account, $type, $netId, $amount)
{ {
SqlHelper::update( SqlHelper::update(
myself()->_getSelfMysql(), myself()->_getMarketMysql(),
't_withdrawal', 't_withdrawal',
array( array(
'idx' => $idx, 'idx' => $idx,