...
This commit is contained in:
parent
1fb85e0bca
commit
ce9cf48da2
@ -441,6 +441,7 @@ class Market(object):
|
|||||||
'url': 'webapp/index.php?c=Market&a=getTransactionRecord',
|
'url': 'webapp/index.php?c=Market&a=getTransactionRecord',
|
||||||
'params': [
|
'params': [
|
||||||
['account', '', '账号id'],
|
['account', '', '账号id'],
|
||||||
|
['type', 0, '物品类型 0:所有 1:英雄 2:武器 3:芯片 5:碎片'],
|
||||||
['start', 0, '分页开始偏移'],
|
['start', 0, '分页开始偏移'],
|
||||||
['page_size', 0, '分页大小'],
|
['page_size', 0, '分页大小'],
|
||||||
],
|
],
|
||||||
|
@ -978,14 +978,26 @@ class MarketController extends BaseController {
|
|||||||
|
|
||||||
public function getTransactionRecord() {
|
public function getTransactionRecord() {
|
||||||
$account = strtolower(getReqVal('account', ''));
|
$account = strtolower(getReqVal('account', ''));
|
||||||
|
$type = getReqVal('type', 0);
|
||||||
$start = getReqVal('start', 0);
|
$start = getReqVal('start', 0);
|
||||||
$page_size = getReqVal('page_size', 10);
|
$page_size = getReqVal('page_size', 10);
|
||||||
|
|
||||||
$conn = myself()->_getMysql('');
|
$conn = myself()->_getMysql('');
|
||||||
|
|
||||||
|
$type_filter_fn = function ($f) {
|
||||||
|
if ($f==0) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 'AND type=' . $f;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$counts = $conn->execQuery(
|
$counts = $conn->execQuery(
|
||||||
'SELECT count(*) as count FROM t_market_transaction_record '.
|
'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(
|
array(
|
||||||
':account' => $account,
|
':account' => $account,
|
||||||
)
|
)
|
||||||
@ -1002,7 +1014,9 @@ class MarketController extends BaseController {
|
|||||||
|
|
||||||
$rows = $conn->execQuery(
|
$rows = $conn->execQuery(
|
||||||
'SELECT * FROM t_market_transaction_record '.
|
'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,
|
'LIMIT '.$start.','.$page_size,
|
||||||
array(
|
array(
|
||||||
':account' => $account,
|
':account' => $account,
|
||||||
@ -1131,7 +1145,7 @@ class MarketController extends BaseController {
|
|||||||
$conn = myself()->_getMysql('');
|
$conn = myself()->_getMysql('');
|
||||||
|
|
||||||
// 1. check order status
|
// 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)) {
|
if (empty($chk)) {
|
||||||
$this->_rspErr(1, 'not found order, orderId='.$orderId);
|
$this->_rspErr(1, 'not found order, orderId='.$orderId);
|
||||||
return;
|
return;
|
||||||
@ -1158,7 +1172,7 @@ class MarketController extends BaseController {
|
|||||||
'tokenid' => $tokenId,
|
'tokenid' => $tokenId,
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
'name' => $chk['c_name'],
|
'name' => $chk['c_name'],
|
||||||
'type' => $chk['c_type'],
|
'type' => $chk['token_type'],
|
||||||
);
|
);
|
||||||
$this->addTransactionRecord($record);
|
$this->addTransactionRecord($record);
|
||||||
$this->_rspOk();
|
$this->_rspOk();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user