From c3a5ca931449adff8d2d87d0ea84edac6c804301 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 1 Nov 2022 13:43:49 +0800 Subject: [PATCH 1/3] 1 --- sql/marketdb.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/sql/marketdb.sql b/sql/marketdb.sql index de71077b..7b4ad289 100644 --- a/sql/marketdb.sql +++ b/sql/marketdb.sql @@ -435,7 +435,6 @@ DROP TABLE IF EXISTS `t_order721`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `t_order721` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', - `order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id', `token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id', `item_uniid` varchar(60) NOT NULL DEFAULT '' COMMENT 'item_uniid', `buyer_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'buyer_address', @@ -453,7 +452,6 @@ CREATE TABLE `t_order721` ( `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), - UNIQUE KEY `order_id` (`order_id`), UNIQUE KEY `nonce` (`nonce`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; /*!40101 SET character_set_client = @saved_cs_client */; From 4ff0206b27aa06a505283b69683529a9099e0d13 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 1 Nov 2022 14:02:08 +0800 Subject: [PATCH 2/3] ... --- doc/Shop.py | 1 + webapp/controller/ShopController.class.php | 31 +++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/doc/Shop.py b/doc/Shop.py index 4077fd2e..5d75efbf 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -86,6 +86,7 @@ class Shop(object): 'params': [ _common.ReqHead(), ['id', 0, '商品唯一id,参见shopGoods表'], + ['token_type', '', "选用币种"] ['goods_num', 0, '商品数量'], ], 'response': [ diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 7253e844..1768027b 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -29,17 +29,42 @@ class ShopController extends BaseAuthedController { public function getGoodsList() { - echo 'getGoodsList'; + $row = SqlHelper::ormSelect( + $this->_getSelfMysql(), + 't_shop_goods' + ); + $this->_rspData(array( + 'goods_list' => $row ? $row : array(), + )); } public function getShopNames() { - echo 'getShopNames'; + $row = SqlHelper::ormSelect( + $this->_getSelfMysql(), + 't_shop_names' + ); + $this->_rspData(array( + 'shop_name_list' => $row ? $row : array(), + )); } public function buyGoodsNew() { - echo 'buyGoodsNew'; + $id = getReqVal('id', 0); + $num = getReqVal('goods_num', 0); + + $row = SqlHelper::ormSelectOne( + $this->_getSelfMysql(), + 't_shop_goods', + array( + 'id' => $id, + ) + ); + $this->_rspData(array( + 'p1' => $id, + 'p2' => $row ? $row : array(), + )); } public function info() From a08260f2023c01df2a2cb84de8f494e1e323b8bf Mon Sep 17 00:00:00 2001 From: songliang Date: Tue, 1 Nov 2022 14:10:23 +0800 Subject: [PATCH 3/3] ... --- webapp/controller/ShopController.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 1768027b..f3fbe003 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -31,7 +31,8 @@ class ShopController extends BaseAuthedController { { $row = SqlHelper::ormSelect( $this->_getSelfMysql(), - 't_shop_goods' + 't_shop_goods', + array(), ); $this->_rspData(array( 'goods_list' => $row ? $row : array(), @@ -42,7 +43,8 @@ class ShopController extends BaseAuthedController { { $row = SqlHelper::ormSelect( $this->_getSelfMysql(), - 't_shop_names' + 't_shop_names', + array(), ); $this->_rspData(array( 'shop_name_list' => $row ? $row : array(), @@ -52,6 +54,7 @@ class ShopController extends BaseAuthedController { public function buyGoodsNew() { $id = getReqVal('id', 0); + $token_type = getReqVal('token_type', ''); $num = getReqVal('goods_num', 0); $row = SqlHelper::ormSelectOne( @@ -62,8 +65,10 @@ class ShopController extends BaseAuthedController { ) ); $this->_rspData(array( - 'p1' => $id, - 'p2' => $row ? $row : array(), + 'id' => $id, + 'token_type' => $token_type, + 'num' => $num, + 'row' => $row ? $row : array(), )); }