200) { myself()->_rspErr(1, 'More withdrawals than today'); return; } $seqId = Withdrawal::add($account, $type, $netId, $amount); myself()->_rspData(array( 'seq_id' => $seqId )); if ($this->isTestMode()) { Withdrawal::testOk($seqId, $account, $type, $netId, $amount); } } public function queryWithdrawalResult() { $account = strtolower(getReqVal('account', '')); $seqId = getReqVal('seq_id', ''); $row = Withdrawal::find($seqId); if (!$row || $row['account'] != $account) { myself()->_rspErr(0, 'not found'); return; } if ($row['state'] == 2) { myself()->_rspErr(2, 'processing'); return; } if ($row['state'] == 3) { myself()->_rspErr(3, 'failed'); return; } $transferDb = Transfer::find($row['bc_txhash']); if (!$transferDb) { myself()->_rspErr(2, 'processing'); return; } if ($transferDb['state'] == 0) { myself()->_rspErr(2, 'processing'); return; } else { myself()->_rspErr(1, 'processing'); return; } } public function queryRechargeResult() { $account = strtolower(getReqVal('account', '')); $txHash = getReqVal('txhash', ''); if ($this->isTestMode()) { } $transferDb = Transfer::find($txHash); if (!$transferDb) { myself()->_rspErr(2, 'processing'); return; } if ($transferDb['state'] == 0) { myself()->_rspErr(2, 'processing'); return; } else { myself()->_rspErr(1, 'processing'); return; } } private function notifyGame($dir, $txhash, $account, $type, $value) { } }