From d00e49a3e1514441c61eb0576ff983ef2413db8a Mon Sep 17 00:00:00 2001 From: songliang Date: Thu, 15 Jun 2023 14:00:43 +0800 Subject: [PATCH] ... --- doc/Shop.py | 14 ++++++++++++++ doc/_common.py | 11 +++++++++++ third_party/phpcommon | 2 +- webapp/controller/ShopController.class.php | 12 ++++++++++++ webapp/mt/PayMethod.php | 22 ++++++++++++++++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 webapp/mt/PayMethod.php diff --git a/doc/Shop.py b/doc/Shop.py index c95cc6d9..6f6a6789 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -142,4 +142,18 @@ class Shop(object): ['status', 0, '订单状态 0:未支付 1:已支付 2:支付失败'], ] }, + { + 'name': 'getPayMethods', + 'desc': '获取支付方式', + 'group': 'Shop', + 'url': 'webapp/index.php?c=Shop&a=getPayMethods', + 'params': [ + _common.ReqHead(), + ['token_type', 0, "选用币种"], + ], + 'response': [ + _common.RspHead(), + ['pay_methods', [_common.PayMethod()], '支付方式列表'], + ] + }, ] diff --git a/doc/_common.py b/doc/_common.py index 8c5b6b20..ae3c2ee0 100644 --- a/doc/_common.py +++ b/doc/_common.py @@ -418,6 +418,17 @@ class Shop(object): ['!goods_list2', [Goods()], '商品列表2'], ] +class PayMethod(object): + + def __init__(self): + self.fields = [ + ['id', 0, '支付方式id'], + ['name', '', '支付方式名称'], + ['icon', '', '支付方式图标'], + ['shop_token_type', 0, '代币类型'], + ['pay_way_code', 0, '支付方式code'], + ] + class Mission(object): def __init__(self): diff --git a/third_party/phpcommon b/third_party/phpcommon index a071cc2b..e658ed5f 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit a071cc2b7fcc2e5c9597d29d07378b4f29ace591 +Subproject commit e658ed5f7e4112801e59206f6da6f01db7131cd1 diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 4769aed4..3540049f 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -6,6 +6,7 @@ require_once('mt/Hero.php'); require_once('mt/Item.php'); require_once('mt/Parameter.php'); require_once('mt/Drop.php'); +require_once('mt/PayMethod.php'); require_once('models/User.php'); require_once('models/Hero.php'); @@ -29,6 +30,7 @@ use models\GunSkin; use models\ShopBuyRecord; use models\Chip; use mt\Shop; +use mt\PayMethod; class ShopController extends BaseAuthedController { @@ -729,6 +731,16 @@ class ShopController extends BaseAuthedController ); } + public function getPayMethods() { + $token_type = getReqVal('token_type', 99); + $payMethods = mt\PayMethod::getPayMethods($token_type); + $this->_rspData( + array( + 'pay_methods' => $payMethods, + ) + ); + } + private function outsideBuy($shopId, $itemId, $itemNum, $costItemId) { $propertyChgService = new services\PropertyChgService(); diff --git a/webapp/mt/PayMethod.php b/webapp/mt/PayMethod.php new file mode 100644 index 00000000..f358732c --- /dev/null +++ b/webapp/mt/PayMethod.php @@ -0,0 +1,22 @@ +