This commit is contained in:
songliang 2023-06-15 14:00:43 +08:00
parent b287aff45f
commit d00e49a3e1
5 changed files with 60 additions and 1 deletions

View File

@ -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()], '支付方式列表'],
]
},
]

View File

@ -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):

@ -1 +1 @@
Subproject commit a071cc2b7fcc2e5c9597d29d07378b4f29ace591
Subproject commit e658ed5f7e4112801e59206f6da6f01db7131cd1

View File

@ -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();

22
webapp/mt/PayMethod.php Normal file
View File

@ -0,0 +1,22 @@
<?php
namespace mt;
use phpcommon;
class PayMethod {
public static function get($id)
{
return getXVal(self::getMetaList(), $id);
}
protected static function getMetaList()
{
if (!self::$metaList) {
self::$metaList = getMetaTable('payMethod@payMethod.php');
}
return self::$metaList;
}
protected static $metaList;
}