From dd8668a471d63812d0a50568542cb06e2fc38e09 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 17 Jul 2023 15:27:49 +0800 Subject: [PATCH 1/4] 1 --- sql/{ => archived}/gamedb2006_migrate_230707_01.sql | 0 sql/{ => archived}/gamedb2006_migrate_230710_01.sql | 0 sql/{ => archived}/gamedb2006_migrate_230713_01.sql | 0 third_party/phpcommon | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename sql/{ => archived}/gamedb2006_migrate_230707_01.sql (100%) rename sql/{ => archived}/gamedb2006_migrate_230710_01.sql (100%) rename sql/{ => archived}/gamedb2006_migrate_230713_01.sql (100%) diff --git a/sql/gamedb2006_migrate_230707_01.sql b/sql/archived/gamedb2006_migrate_230707_01.sql similarity index 100% rename from sql/gamedb2006_migrate_230707_01.sql rename to sql/archived/gamedb2006_migrate_230707_01.sql diff --git a/sql/gamedb2006_migrate_230710_01.sql b/sql/archived/gamedb2006_migrate_230710_01.sql similarity index 100% rename from sql/gamedb2006_migrate_230710_01.sql rename to sql/archived/gamedb2006_migrate_230710_01.sql diff --git a/sql/gamedb2006_migrate_230713_01.sql b/sql/archived/gamedb2006_migrate_230713_01.sql similarity index 100% rename from sql/gamedb2006_migrate_230713_01.sql rename to sql/archived/gamedb2006_migrate_230713_01.sql diff --git a/third_party/phpcommon b/third_party/phpcommon index 214a4377..1913ff11 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit 214a4377c3688c70e9a6ceb0b3495fb4aaec7507 +Subproject commit 1913ff111893e9583dff228c9bc24669ec2e86b0 From 05f28d5f65f0ff3d71a6384d3aca51cca66c0b3a Mon Sep 17 00:00:00 2001 From: songliang Date: Mon, 17 Jul 2023 17:23:34 +0800 Subject: [PATCH 2/4] ... --- webapp/controller/MarketController.class.php | 28 -------------------- 1 file changed, 28 deletions(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 71f8ab77..44206537 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -230,8 +230,6 @@ class MarketController extends BaseAuthedController public function listSellNfts() { - $this->autoRestoreBuyingOrders(); - $account = strtolower(getReqVal('account', '')); $token = getReqVal('token', ''); $start = getReqVal('start', 0); @@ -930,30 +928,4 @@ class MarketController extends BaseAuthedController return true; } - private function autoRestoreBuyingOrders() - { - $conn = myself()->_getSelfMysql(); - - $rows = $conn->execQuery( - 'SELECT * FROM t_market_store ' . - 'WHERE status=3 AND buytime<:buytime', - array( - ':buytime' => myself()->_getNowTime() - 3600 * 24 * 1, - ) - ); - - foreach ($rows as $row) { - $r = SqlHelper::update( - myself()->_getSelfMysql(), - 't_market_store', - array( - 'idx' => $row['idx'], - ), - array( - 'status' => 0, - 'buytime' => 0, - ) - ); - } - } } From ec615171d36bdd188f48416795fb9233d5148472 Mon Sep 17 00:00:00 2001 From: songliang Date: Mon, 17 Jul 2023 17:23:40 +0800 Subject: [PATCH 3/4] ... --- third_party/phpcommon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/phpcommon b/third_party/phpcommon index 1913ff11..214a4377 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit 1913ff111893e9583dff228c9bc24669ec2e86b0 +Subproject commit 214a4377c3688c70e9a6ceb0b3495fb4aaec7507 From 1fb7c3ad877ac1ee49b2e508008b49bc85f809af Mon Sep 17 00:00:00 2001 From: songliang Date: Mon, 17 Jul 2023 19:24:46 +0800 Subject: [PATCH 4/4] ... --- 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; }