This commit is contained in:
songliang 2023-07-17 19:33:50 +08:00
commit 457f1ff963
4 changed files with 16 additions and 5 deletions

View File

@ -336,10 +336,11 @@ class MarketController extends BaseAuthedController
};
$conn = myself()->_getSelfMysql();
$now = myself()->_getNowTime();
$counts = $conn->execQuery(
'SELECT count(idx) as count FROM t_market_store ' .
'WHERE token_type=:token_type AND status=0 ' .
'WHERE token_type=:token_type AND (status=0 OR status=3) AND buytime<:nowThat ' .
$job_filter_fn($job_filter_array) .
$lv_filter_fn($lv_filter) .
$quality_filter_fn($quality_filter) .
@ -350,6 +351,7 @@ class MarketController extends BaseAuthedController
$order_fn($order_method, $order_asc),
array(
':token_type' => $type,
':nowThat' => $now - 3600 * 24,
)
);
@ -364,7 +366,7 @@ class MarketController extends BaseAuthedController
$rows = $conn->execQuery(
'SELECT * FROM t_market_store ' .
'WHERE token_type=:token_type AND status=0 ' .
'WHERE token_type=:token_type AND (status=0 OR status=3) AND buytime<:nowThat ' .
$job_filter_fn($job_filter_array) .
$lv_filter_fn($lv_filter) .
$quality_filter_fn($quality_filter) .
@ -376,6 +378,7 @@ class MarketController extends BaseAuthedController
'LIMIT ' . $start . ',' . $page_size,
array(
':token_type' => $type,
':nowThat' => $now - 3600 * 24,
)
);
@ -866,13 +869,15 @@ class MarketController extends BaseAuthedController
// error_log('listMySelledNfts ' . $account . ' ' . $type);
$conn = myself()->_getSelfMysql();
$now = myself()->_getNowTime();
$rows = $conn->execQuery(
'SELECT * FROM t_market_store ' .
'WHERE owner_address=:account AND token_type=:token_type AND status=0 ',
'WHERE owner_address=:account AND token_type=:token_type AND (status=0 OR status=3) AND buytime<:nowThat ',
array(
':account' => $account,
':token_type' => $type,
':nowThat' => $now - 3600 * 24,
)
);
@ -894,10 +899,9 @@ class MarketController extends BaseAuthedController
$row = SqlHelper::selectOne(
myself()->_getSelfMysql(),
't_market_store',
array('order_id', 'item_id', 'amount', 's_price', 'owner_address'),
array('order_id', 'item_id', 'amount', 's_price', 'owner_address', 'status', 'buytime'),
array(
'idx' => $idx,
'status' => 0,
)
);
if (!$row) {
@ -906,6 +910,13 @@ class MarketController extends BaseAuthedController
if (!$row['item_id']) {
return null;
}
if (!$row['status']==3 && !$row['status']==0) {
return null;
}
$now = myself()->_getNowTime();
if ($row['buytime'] > $now - 3600 * 24) {
return null;
}
return $row;
}