diff --git a/doc/Shop.py b/doc/Shop.py index f6f54ad..2375cb0 100644 --- a/doc/Shop.py +++ b/doc/Shop.py @@ -45,6 +45,7 @@ class Shop(object): 'params': [ _common.ReqHead(), ['item_id', 0, '商品id'], + ['item_num', 0, '购买数量'], ['cost_item_id', 0, '支付方式'], ], 'response': [ diff --git a/webapp/controller/ShopController.class.php b/webapp/controller/ShopController.class.php index 89bfe6b..4dc2422 100644 --- a/webapp/controller/ShopController.class.php +++ b/webapp/controller/ShopController.class.php @@ -74,7 +74,9 @@ class ShopController extends BaseAuthedController { public function outsideBuy() { - + $itemId = getReqVal('item_id', 0); + $itemNum = getReqVal('item_num', 0); + $costItemId = getReqVal('cost_item_id', 0); } public function getOutsidePriceInfo() diff --git a/webapp/mt/NewItem.php b/webapp/mt/NewItem.php deleted file mode 100644 index b4f59c4..0000000 --- a/webapp/mt/NewItem.php +++ /dev/null @@ -1,36 +0,0 @@ -= 2) - { - $goodsNum = $goodsIDArr[1]; - } - $priceID = $priceArr[0]; - $priceNum = $priceArr[1]; - $specailPrice = 0; - $limitType = 0; - - if($discountStrArr) - { - $len1 = count($discountStrArr); - if($len1 > 0) - { - $specailPrice = $discountStrArr[$i]; - } - } - if($limitStrArr) - { - $len1 = count($limitStrArr); - if($len1 > 0) - { - if($len1 > $i) - { - $limitType = $limitStrArr[$i]; - } - } - } - - - $itemInfo = array("goodsID"=>$goodsID,"goodsNum"=>$goodsNum, - "priceID"=>$priceID,"priceNum"=>$priceNum, - "specailPrice"=>$specailPrice,"limitType"=>$limitType); - self::$itemArr[$itemInfo['goodsID']] = $itemInfo; - } - } - } - - $itemData = null; - if(self::$itemArr[$itemID]) - { - $itemData = self::$itemArr[$itemID]; - } - - return $itemData; - - - } - - public static function getGoodsInfo($meta, $goodsId) - { - $goodsStrArr = explode("|", $meta['goods']); - $priceStrArr = explode("|", $meta['price']); - if (count($goodsStrArr) != count($priceStrArr)) { - return null; - } - $idx = -1; - { - $i = 0; - array_filter($goodsStrArr, function($str) use(&$i, &$idx, $goodsId) { - if ($idx != -1) { - $strArr = explode(":", $str); - if (count($strArr) >= 2) { - if ($strArr[0] == $goodsId) { - $idx = $i; - return true; - } - } - } - ++$i; - return false; - }); - } - if ($idx <= 0) { - return null; - } - $info = array( - 'goodsId' => 0, - 'goodsNum' => 0, - 'costItemId' => 0, - 'costItemNum' => 0 - ); - { - $strArr = explode(":", $goodsStrArr[$idx]); - $info['goodsId'] = $strArr[0]; - $info['goodsNum'] = $strArr[1]; - } - { - $strArr = explode(":", $priceStrArr[$idx]); - if (count($strArr) < 2) { - return null; - } - $info['costItemId'] = $strArr[0]; - $info['costItemNum'] = $strArr[1]; - } - return $info; - } - - protected static $itemArr; - protected static $meta; - -} diff --git a/webapp/mt/newShop.php b/webapp/mt/newShop.php deleted file mode 100644 index 4411e29..0000000 --- a/webapp/mt/newShop.php +++ /dev/null @@ -1,124 +0,0 @@ -= 2) - { - $goodsNum = $goodsIDArr[1]; - } - $priceID = $priceArr[0]; - $priceNum = $priceArr[1]; - $specailPrice = 0; - $limitType = 0; - - if($discountStrArr) - { - $len1 = count($discountStrArr); - if($len1 > 0) - { - $specailPrice = $discountStrArr[$i]; - } - } - if($limitStrArr) - { - $len1 = count($limitStrArr); - if($len1 > 0) - { - if($len1 > $i) - { - $limitType = $limitStrArr[$i]; - } - } - } - - - $itemInfo = array("goodsID"=>$goodsID,"goodsNum"=>$goodsNum, - "priceID"=>$priceID,"priceNum"=>$priceNum, - "specailPrice"=>$specailPrice,"limitType"=>$limitType); - self::$itemArr[$itemInfo['goodsID']] = $itemInfo; - } - } - } - - $itemData = null; - if(self::$itemArr[$itemID]) - { - $itemData = self::$itemArr[$itemID]; - } - - return $itemData; - - - } - protected static $itemArr; - protected static $meta; - -}