diff --git a/webapp/controller/WalletController.class.php b/webapp/controller/WalletController.class.php index f5ae19b2..fc816264 100644 --- a/webapp/controller/WalletController.class.php +++ b/webapp/controller/WalletController.class.php @@ -31,7 +31,7 @@ class WalletController extends BaseController { $netId = getReqVal('net_id', ''); $amount = getReqVal('amount', ''); $times = Withdrawal::getTodayWithdrawalTimes($account); - if ($times) { + if ($times > 200) { myself()->_rspErr(1, 'More withdrawals than today'); return; } @@ -40,7 +40,7 @@ class WalletController extends BaseController { 'seq_id' => $seqId )); if ($this->isTestMode()) { - Withdrawal::testOk($seqid, $account, $type, $netId, $amount); + Withdrawal::testOk($seqId, $account, $type, $netId, $amount); } } diff --git a/webapp/models/Withdrawal.php b/webapp/models/Withdrawal.php index 61d0431e..e0930e40 100644 --- a/webapp/models/Withdrawal.php +++ b/webapp/models/Withdrawal.php @@ -13,7 +13,7 @@ class Withdrawal extends BaseModel { public static function getTodayWithdrawalTimes($account) { $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( ':account' => $account, ':now_dayseconds' => myself()->_getNowDaySeconds() @@ -40,10 +40,10 @@ class Withdrawal extends BaseModel { return $seqId; } - public static function get($seqId) + public static function find($seqId) { $row = SqlHelper::ormSelectOne( - myself()->_getSelfMysql(), + myself()->_getMarketMysql(), 't_withdrawal', array( 'idx' => $seqId, @@ -55,7 +55,7 @@ class Withdrawal extends BaseModel { public static function testOk($idx, $account, $type, $netId, $amount) { SqlHelper::update( - myself()->_getSelfMysql(), + myself()->_getMarketMysql(), 't_withdrawal', array( 'idx' => $idx,