1
This commit is contained in:
parent
8dec95b4cf
commit
6a98515527
77
doc/NShop.py
77
doc/NShop.py
@ -6,17 +6,6 @@ class NShop(object):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.apis = [
|
self.apis = [
|
||||||
{
|
|
||||||
'desc': 'getGunInfo',
|
|
||||||
'group': 'NShop',
|
|
||||||
'url': 'webapp/index.php?c=NShop&a=getGunInfo',
|
|
||||||
'params': [
|
|
||||||
_common.ReqHead(),
|
|
||||||
],
|
|
||||||
'response': [
|
|
||||||
_common.RspHead(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'desc': 'getShopData',
|
'desc': 'getShopData',
|
||||||
'group': 'NShop',
|
'group': 'NShop',
|
||||||
@ -28,50 +17,6 @@ class NShop(object):
|
|||||||
_common.RspHead(),
|
_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',
|
'desc': 'buyItem',
|
||||||
'group': 'NShop',
|
'group': 'NShop',
|
||||||
@ -83,26 +28,4 @@ class NShop(object):
|
|||||||
_common.RspHead(),
|
_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(),
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
@ -7,19 +7,7 @@ require_once('mt/GunSkin.php');
|
|||||||
class NShopController extends BaseAuthedController {
|
class NShopController extends BaseAuthedController {
|
||||||
|
|
||||||
private $m_timeSeed = 0;
|
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()
|
public function getShopData()
|
||||||
{
|
{
|
||||||
$account_id = $_REQUEST['account_id'];
|
$account_id = $_REQUEST['account_id'];
|
||||||
@ -38,7 +26,7 @@ class NShopController extends BaseAuthedController {
|
|||||||
$resultArr = array("heroData"=>$heroData,"heroSkin"=>$heroSkinData,"gunSkin"=>$gunSkinData,"allItem"=>$allItemCfg);
|
$resultArr = array("heroData"=>$heroData,"heroSkin"=>$heroSkinData,"gunSkin"=>$gunSkinData,"allItem"=>$allItemCfg);
|
||||||
$this->sendDataToClient(100,"getShopData",$resultArr);
|
$this->sendDataToClient(100,"getShopData",$resultArr);
|
||||||
}
|
}
|
||||||
public function getAllItem()
|
private function getAllItem()
|
||||||
{
|
{
|
||||||
$draw_uuid = 'game2005api_newShopAllItem_uuid:' . $_REQUEST['account_id'];
|
$draw_uuid = 'game2005api_newShopAllItem_uuid:' . $_REQUEST['account_id'];
|
||||||
$allItemCfg = null;
|
$allItemCfg = null;
|
||||||
@ -102,7 +90,7 @@ class NShopController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
return $allItemCfg;
|
return $allItemCfg;
|
||||||
}
|
}
|
||||||
public function getLimitTypeCnt($_itemID)
|
private function getLimitTypeCnt($_itemID)
|
||||||
{
|
{
|
||||||
$tmpCnt = 0;
|
$tmpCnt = 0;
|
||||||
$draw_uuid = 'game2005api_newShopLimit'.$_itemID.'_uuid:' . $_REQUEST['account_id'];
|
$draw_uuid = 'game2005api_newShopLimit'.$_itemID.'_uuid:' . $_REQUEST['account_id'];
|
||||||
@ -138,7 +126,7 @@ class NShopController extends BaseAuthedController {
|
|||||||
$randN = floor($tmpN*$_num);
|
$randN = floor($tmpN*$_num);
|
||||||
return $randN;
|
return $randN;
|
||||||
}
|
}
|
||||||
public function getItemIDByGoodsID($_goodsID)
|
private function getItemIDByGoodsID($_goodsID)
|
||||||
{
|
{
|
||||||
$itemCfg = null;
|
$itemCfg = null;
|
||||||
$shopMeta = mt\NewItem::getItemCfgByID($_goodsID);
|
$shopMeta = mt\NewItem::getItemCfgByID($_goodsID);
|
||||||
@ -168,7 +156,7 @@ class NShopController extends BaseAuthedController {
|
|||||||
|
|
||||||
return $itemCfg;
|
return $itemCfg;
|
||||||
}
|
}
|
||||||
public function buyGunSkin($gunID,$skinID)
|
private function buyGunSkin($gunID,$skinID)
|
||||||
{
|
{
|
||||||
phpcommon\SqlHelper::insertOrUpdate
|
phpcommon\SqlHelper::insertOrUpdate
|
||||||
($this->getSelfMysql(),
|
($this->getSelfMysql(),
|
||||||
@ -359,28 +347,6 @@ class NShopController extends BaseAuthedController {
|
|||||||
$resultArr = array("goodsID"=>$goodsID,"goodsType"=>$goodsType,"buyCnt"=>$curBuyCnt);
|
$resultArr = array("goodsID"=>$goodsID,"goodsType"=>$goodsType,"buyCnt"=>$curBuyCnt);
|
||||||
$this->sendDataToClient($code,"getShopData",$resultArr);
|
$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)
|
private function calculateLimitGoods($_goodsID)
|
||||||
{
|
{
|
||||||
$tmpAllData = $this->getAllItem();
|
$tmpAllData = $this->getAllItem();
|
||||||
@ -405,7 +371,7 @@ class NShopController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
return $goodsData;
|
return $goodsData;
|
||||||
}
|
}
|
||||||
public function initAllItem()
|
private function initAllItem()
|
||||||
{
|
{
|
||||||
$shopCfg = mt\NewShop::getShopCfg();
|
$shopCfg = mt\NewShop::getShopCfg();
|
||||||
$tmpInex = 0;
|
$tmpInex = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user