From 1fb7c3ad877ac1ee49b2e508008b49bc85f809af Mon Sep 17 00:00:00 2001 From: songliang Date: Mon, 17 Jul 2023 19:24:46 +0800 Subject: [PATCH] ... --- webapp/controller/MarketController.class.php | 21 +++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 44206537..fc88ca0e 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -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, ) ); @@ -865,13 +868,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, ) ); @@ -893,10 +898,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) { @@ -905,6 +909,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; }