From 4506670c2c974ee61067d083de14c846aad24897 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 7 Dec 2022 17:53:47 +0800 Subject: [PATCH 1/5] ... --- webapp/controller/MarketController.class.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index ebc85936..7540a42d 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -684,22 +684,24 @@ class MarketController extends BaseController { $conn = myself()->_getMysql(''); $nft = Nft::getNft($nft_token); - SqlHelper::insert( + $nftDetail = Nft::toDto($nft); + // echo json_encode($nftDetail), json_encode($nft); + $r = SqlHelper::insert( $conn, 't_market_store', array( 'token_id' => $nft_token, - 'token_type' => $nft['token_type'], + 'token_type' => $nftDetail['type'], 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime(), 's_price' => $s_price, - 'c_name' => $nft['name'], - 'c_job' => $nft['job'], - 'c_lv' => $nft['level'], - 'c_id' => $nft['idx'], + 'c_name' => $nftDetail['info']['name'], + 'c_job' => $nftDetail['info']['job'], + 'c_lv' => $nftDetail['info']['level'], + 'c_id' => $nftDetail['item_id'], ) ); - + echo json_encode($r); $this->_rspOk(); } From 1ba487df828603c2591bd32d767426fdc0a0574e Mon Sep 17 00:00:00 2001 From: songliang Date: Wed, 7 Dec 2022 18:13:53 +0800 Subject: [PATCH 2/5] ... --- webapp/controller/MarketController.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 7540a42d..442c2a54 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -714,6 +714,9 @@ class MarketController extends BaseController { $signature = getReqVal('signature', ''); $net_id = getReqVal('net_id', ''); + $conn = myself()->_getMysql(''); + $conn->execScript('DELETE FROM t_market_store', array('token_id' => $nft_token)); + $this->_rspOk(); } From d4ee493514b9bea5ef8aca8b5f1159e73d7dd1fd Mon Sep 17 00:00:00 2001 From: songliang Date: Wed, 7 Dec 2022 18:53:33 +0800 Subject: [PATCH 3/5] ... --- webapp/controller/MarketController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 442c2a54..710237f2 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -715,7 +715,7 @@ class MarketController extends BaseController { $net_id = getReqVal('net_id', ''); $conn = myself()->_getMysql(''); - $conn->execScript('DELETE FROM t_market_store', array('token_id' => $nft_token)); + $conn->execScript('DELETE FROM t_market_store WHERE'.'token_id='.$nft_token); $this->_rspOk(); } From c7a1f919b7b667ac94d6d022ae0a1d30de178a74 Mon Sep 17 00:00:00 2001 From: songliang Date: Wed, 7 Dec 2022 18:59:00 +0800 Subject: [PATCH 4/5] ... --- webapp/controller/MarketController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index 710237f2..f4f72e5d 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -696,7 +696,7 @@ class MarketController extends BaseController { 'modifytime' => myself()->_getNowTime(), 's_price' => $s_price, 'c_name' => $nftDetail['info']['name'], - 'c_job' => $nftDetail['info']['job'], + 'c_job' => $nftDetail['info']['job'] ? $nftDetail['info']['job'] : -1, 'c_lv' => $nftDetail['info']['level'], 'c_id' => $nftDetail['item_id'], ) From 482a77c105ef7f70f97a668a007a59a80fa5b860 Mon Sep 17 00:00:00 2001 From: songliang Date: Wed, 7 Dec 2022 18:59:52 +0800 Subject: [PATCH 5/5] ... --- webapp/controller/MarketController.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/controller/MarketController.class.php b/webapp/controller/MarketController.class.php index f4f72e5d..5b5d3112 100644 --- a/webapp/controller/MarketController.class.php +++ b/webapp/controller/MarketController.class.php @@ -715,7 +715,7 @@ class MarketController extends BaseController { $net_id = getReqVal('net_id', ''); $conn = myself()->_getMysql(''); - $conn->execScript('DELETE FROM t_market_store WHERE'.'token_id='.$nft_token); + $conn->execScript('DELETE FROM t_market_store WHERE '.'token_id=\''.$nft_token.'\''); $this->_rspOk(); }