From 6a9851552791a2f758e74b8f9be4e334bdab59b7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 18 Nov 2021 20:00:55 +0800 Subject: [PATCH] 1 --- doc/NShop.py | 77 --------------------- webapp/controller/NShopController.class.php | 48 ++----------- 2 files changed, 7 insertions(+), 118 deletions(-) diff --git a/doc/NShop.py b/doc/NShop.py index f32f0ab..b654f5e 100644 --- a/doc/NShop.py +++ b/doc/NShop.py @@ -6,17 +6,6 @@ class NShop(object): def __init__(self): self.apis = [ - { - 'desc': 'getGunInfo', - 'group': 'NShop', - 'url': 'webapp/index.php?c=NShop&a=getGunInfo', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, { 'desc': 'getShopData', 'group': 'NShop', @@ -28,50 +17,6 @@ class NShop(object): _common.RspHead(), ] }, - { - 'desc': 'getAllItem', - 'group': 'NShop', - 'url': 'webapp/index.php?c=NShop&a=getAllItem', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, - { - 'desc': 'getLimitTypeCnt', - 'group': 'NShop', - 'url': 'webapp/index.php?c=NShop&a=getLimitTypeCnt', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, - { - 'desc': 'getItemIDByGoodsID', - 'group': 'NShop', - 'url': 'webapp/index.php?c=NShop&a=getItemIDByGoodsID', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, - { - 'desc': 'buyGunSkin', - 'group': 'NShop', - 'url': 'webapp/index.php?c=NShop&a=buyGunSkin', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, { 'desc': 'buyItem', 'group': 'NShop', @@ -83,26 +28,4 @@ class NShop(object): _common.RspHead(), ] }, - { - 'desc': 'updateLimitGoodsCnt', - 'group': 'NShop', - 'url': 'webapp/index.php?c=NShop&a=updateLimitGoodsCnt', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, - { - 'desc': 'initAllItem', - 'group': 'NShop', - 'url': 'webapp/index.php?c=NShop&a=initAllItem', - 'params': [ - _common.ReqHead(), - ], - 'response': [ - _common.RspHead(), - ] - }, ] diff --git a/webapp/controller/NShopController.class.php b/webapp/controller/NShopController.class.php index 20a1c0f..1259133 100644 --- a/webapp/controller/NShopController.class.php +++ b/webapp/controller/NShopController.class.php @@ -7,19 +7,7 @@ require_once('mt/GunSkin.php'); class NShopController extends BaseAuthedController { private $m_timeSeed = 0; - public function getGunInfo() - { - $account_id = $_REQUEST['account_id']; - $conn = $this->getMysql($account_id); - - // $row = $conn->execQueryOne('SELECT guildcoin_num FROM user WHERE accountid=:accountid;', - // array( - // ':accountid' => $account_id - // )); - $sqlStr = "SELECT * FROM gun_intensify WHERE accountid=:accountid; "; - $row = $conn->execQuery($sqlStr,array(':accountid' => $account_id)); - $this->sendDataToClient(0,"test02",$row); - } + public function getShopData() { $account_id = $_REQUEST['account_id']; @@ -38,7 +26,7 @@ class NShopController extends BaseAuthedController { $resultArr = array("heroData"=>$heroData,"heroSkin"=>$heroSkinData,"gunSkin"=>$gunSkinData,"allItem"=>$allItemCfg); $this->sendDataToClient(100,"getShopData",$resultArr); } - public function getAllItem() + private function getAllItem() { $draw_uuid = 'game2005api_newShopAllItem_uuid:' . $_REQUEST['account_id']; $allItemCfg = null; @@ -102,7 +90,7 @@ class NShopController extends BaseAuthedController { } return $allItemCfg; } - public function getLimitTypeCnt($_itemID) + private function getLimitTypeCnt($_itemID) { $tmpCnt = 0; $draw_uuid = 'game2005api_newShopLimit'.$_itemID.'_uuid:' . $_REQUEST['account_id']; @@ -138,7 +126,7 @@ class NShopController extends BaseAuthedController { $randN = floor($tmpN*$_num); return $randN; } - public function getItemIDByGoodsID($_goodsID) + private function getItemIDByGoodsID($_goodsID) { $itemCfg = null; $shopMeta = mt\NewItem::getItemCfgByID($_goodsID); @@ -168,7 +156,7 @@ class NShopController extends BaseAuthedController { return $itemCfg; } - public function buyGunSkin($gunID,$skinID) + private function buyGunSkin($gunID,$skinID) { phpcommon\SqlHelper::insertOrUpdate ($this->getSelfMysql(), @@ -359,28 +347,6 @@ class NShopController extends BaseAuthedController { $resultArr = array("goodsID"=>$goodsID,"goodsType"=>$goodsType,"buyCnt"=>$curBuyCnt); $this->sendDataToClient($code,"getShopData",$resultArr); } - public function updateLimitGoodsCnt() - { - $tmpAllData = $this->getAllItem(); - $allItemCfg = $tmpAllData->goodsData;//$tmpAllData["goodsData"]; - $goodsData = null; - $len = count($allItemCfg); - for($i = 0 ;$i < $len; $i++) - { - $len2 = count($allItemCfg[$i]); - //error_log("当前列表======".$len2."==".$i); - for($j = 0; $j < $len2; $j ++) - { - $tmpGoodsID = $allItemCfg[$i][$j]->goodsID; - // error_log("获得道具信息========="."==".$tmpGoodsID."==".$_goodsID.json_encode($allItemCfg[$i][$j])); - if($tmpGoodsID == $_goodsID) - { - $goodsData = $allItemCfg[$i][$j]; - break; - } - } - } - } private function calculateLimitGoods($_goodsID) { $tmpAllData = $this->getAllItem(); @@ -405,7 +371,7 @@ class NShopController extends BaseAuthedController { } return $goodsData; } - public function initAllItem() + private function initAllItem() { $shopCfg = mt\NewShop::getShopCfg(); $tmpInex = 0; @@ -674,4 +640,4 @@ class NShopController extends BaseAuthedController { $row = $conn->execQuery($sqlStr2,array(':accountid' => $account_id,':coin_num' => $_money,':diamond_num' => $_diamond)); } -} \ No newline at end of file +}