From 9b4a993c5a8c83f3d37a5515a2744a5c9ee76dd8 Mon Sep 17 00:00:00 2001 From: songliang Date: Fri, 14 Jul 2023 17:42:06 +0800 Subject: [PATCH] ... --- webapp/controller/MarketController.class.php | 78 +------------------- 1 file changed, 2 insertions(+), 76 deletions(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index c266ea1f..4dc0b3b9 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -491,7 +491,7 @@ class MarketController extends BaseAuthedController $this->_rspErr(1, 's_price not found'); return; } - if ($s_price<=0) { + if ($s_price <= 0) { $this->_rspErr(1, 's_price must > 0'); return; } @@ -501,7 +501,7 @@ class MarketController extends BaseAuthedController $this->_rspErr(1, 'amount not found'); return; } - if ($amount<=0) { + if ($amount <= 0) { $this->_rspErr(1, 'amount must > 0'); return; } @@ -877,78 +877,4 @@ class MarketController extends BaseAuthedController return true; } - - private function getSupportedCurrencyTypes() - { - $types = array(); - if (SERVER_ENV == _ONLINE) { - array_push($types, array( - 'name' => 'USDT', - 'address' => '0xc22Ffa318051d8aF4E5f2E2732d7049486fcE093', - )); - } else { - array_push($types, array( - 'name' => 'USDT', - 'address' => '0xc22Ffa318051d8aF4E5f2E2732d7049486fcE093', - )); - } - $this->_rspData(array( - 'list' => $types, - )); - } - - private function getTransactionRecord() - { - $account = strtolower(getReqVal('account', '')); - $type = getReqVal('type', 0); - $start = getReqVal('start', 0); - $page_size = getReqVal('page_size', 10); - $page_size = max(1, min(100, $page_size)); - $conn = myself()->_getSelfMysql(); - - $type_filter_fn = function ($f) { - if ($f == 0) { - return ''; - } else { - return 'AND type=' . $f; - } - }; - - $counts = $conn->execQuery( - 'SELECT count(idx) as count FROM t_market_transaction_record ' . - 'WHERE (seller=:account OR buyer=:account) ' . - $type_filter_fn($type) . - ' ORDER BY createtime DESC', - array( - ':account' => $account, - ) - ); - - $total = $counts[0]['count']; - $page_end = $start + $page_size; - if ($page_end > $total) { - $page_end = $total; - $start = $total - 1; - $start = intval($start / $page_size) * $page_size; - if ($start < 0) $start = 0; - } - - $rows = $conn->execQuery( - 'SELECT * FROM t_market_transaction_record ' . - 'WHERE (seller=:account OR buyer=:account) ' . - $type_filter_fn($type) . - ' ORDER BY createtime DESC ' . - 'LIMIT ' . $start . ',' . $page_size, - array( - ':account' => $account, - ) - ); - - $this->_rspData(array( - "total" => $total, - "start" => $start, - "page_size" => $page_size, - 'nfts' => $rows, - )); - } }