From a5283e79eff982cd86aea791e7b31bd9b0205ae1 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 2 Aug 2023 17:03:52 +0800 Subject: [PATCH] 1 --- doc/Shop.py | 1 + webapp/controller/ShopController.class.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/Shop.py b/doc/Shop.py index 94737dad..859a207a 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -43,6 +43,7 @@ class Shop(object): 'url': 'webapp/index.php?c=Shop&a=outappPurchase', 'params': [ _common.ReqHead(), + ['platform', 0, '平台 1:android 2:ios'], ['goods_id', '', '商品唯一id'], ['goods_num', 0, '商品数量'], ['network', '', '渠道那边定义的id'], diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index d06c4747..256698ba 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -160,6 +160,7 @@ class ShopController extends BaseAuthedController { $goodsId = getReqVal('goods_id', 0); $goodsNum = getReqVal('goods_num', 1); + $platform = getReqVal('platform', ''); $network = getReqVal('network', ''); $crypto = getReqVal('crypto', ''); $fiat = getReqVal('fiat', ''); @@ -172,6 +173,14 @@ class ShopController extends BaseAuthedController { $this->_rspErr(1, 'address is empty'); return; } + if (!in_array($platform, + array( + 1, + 2 + ))) { + $this->_rspErr(1, 'paramater error platform'); + return; + } if ($goodsNum != 1) { $this->_rspErr(1, 'goods_num is invalid'); return; @@ -229,7 +238,9 @@ class ShopController extends BaseAuthedController { $nowTime, $slat ); - $platform = 1; + foreach ($params as &$value) { + $value = '' . $value; + } OutAppOrder::add( $orderId, $platform,