This commit is contained in:
songliang 2023-01-28 13:31:41 +08:00
parent 1fb85e0bca
commit ce9cf48da2
2 changed files with 19 additions and 4 deletions

View File

@ -441,6 +441,7 @@ class Market(object):
'url': 'webapp/index.php?c=Market&a=getTransactionRecord',
'params': [
['account', '', '账号id'],
['type', 0, '物品类型 0:所有 1:英雄 2:武器 3:芯片 5:碎片'],
['start', 0, '分页开始偏移'],
['page_size', 0, '分页大小'],
],

View File

@ -978,14 +978,26 @@ class MarketController extends BaseController {
public function getTransactionRecord() {
$account = strtolower(getReqVal('account', ''));
$type = getReqVal('type', 0);
$start = getReqVal('start', 0);
$page_size = getReqVal('page_size', 10);
$conn = myself()->_getMysql('');
$type_filter_fn = function ($f) {
if ($f==0) {
return '';
}
else {
return 'AND type=' . $f;
}
};
$counts = $conn->execQuery(
'SELECT count(*) as count FROM t_market_transaction_record '.
'WHERE seller=:account OR buyer=:account ORDER BY createtime DESC',
'WHERE (seller=:account OR buyer=:account) '.
$type_filter_fn($type).
' ORDER BY createtime DESC',
array(
':account' => $account,
)
@ -1002,7 +1014,9 @@ class MarketController extends BaseController {
$rows = $conn->execQuery(
'SELECT * FROM t_market_transaction_record '.
'WHERE seller=:account OR buyer=:account ORDER BY createtime DESC '.
'WHERE (seller=:account OR buyer=:account) '.
$type_filter_fn($type).
' ORDER BY createtime DESC '.
'LIMIT '.$start.','.$page_size,
array(
':account' => $account,
@ -1131,7 +1145,7 @@ class MarketController extends BaseController {
$conn = myself()->_getMysql('');
// 1. check order status
$chk = SqlHelper::selectOne($conn, 't_market_store', array('status','idx', 'c_name', 'c_type'), array('o_link' => $orderId));
$chk = SqlHelper::selectOne($conn, 't_market_store', array('status','idx', 'c_name', 'token_type'), array('o_link' => $orderId));
if (empty($chk)) {
$this->_rspErr(1, 'not found order, orderId='.$orderId);
return;
@ -1158,7 +1172,7 @@ class MarketController extends BaseController {
'tokenid' => $tokenId,
'amount' => $amount,
'name' => $chk['c_name'],
'type' => $chk['c_type'],
'type' => $chk['token_type'],
);
$this->addTransactionRecord($record);
$this->_rspOk();