...
This commit is contained in:
parent
bd501f9356
commit
a3c3a9ffc6
17
doc/Shop.py
17
doc/Shop.py
@ -232,5 +232,20 @@ class Shop(object):
|
|||||||
_common.RspHead(),
|
_common.RspHead(),
|
||||||
['!result', [_common.BlindBoxResult()], '盲盒结果列表'],
|
['!result', [_common.BlindBoxResult()], '盲盒结果列表'],
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
'name': 'getChestItems',
|
||||||
|
'desc': '获取宝箱可能出现的物品列表',
|
||||||
|
'group': 'Shop',
|
||||||
|
'url': 'webapp/index.php?c=Shop&a=getChestItems',
|
||||||
|
'params': [
|
||||||
|
_common.ReqHead(),
|
||||||
|
['goods_id', 0, '宝箱物品id item_id'],
|
||||||
|
],
|
||||||
|
'response': [
|
||||||
|
_common.RspHead(),
|
||||||
|
['!items', [0], '宝箱物品列表'],
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -1233,14 +1233,32 @@ class ShopController extends BaseAuthedController
|
|||||||
{
|
{
|
||||||
$goods_id = getReqVal('goods_id', 0);
|
$goods_id = getReqVal('goods_id', 0);
|
||||||
|
|
||||||
if ($goods_id < 900001 || $goods_id > 900004) {
|
$meta = mt\Item::get($goods_id);
|
||||||
|
if ($meta['type'] != mt\Item::CHEST_BOX_TYPE) {
|
||||||
$this->_rspErr(2, 'goods_id is invalid');
|
$this->_rspErr(2, 'goods_id is invalid');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$meta = mt\Item::get($goods_id);
|
|
||||||
$chestType = $meta['sub_type'];
|
$chestType = $meta['sub_type'];
|
||||||
$itemStore = mt\ShopChest::getRandomItemListByChestType($chestType);
|
$itemStore = mt\ShopChest::getRandomItemListByChestType($chestType);
|
||||||
|
$record = array();
|
||||||
|
foreach ($itemStore as $key => $value) {
|
||||||
|
foreach ($value as $k => $v) {
|
||||||
|
$record[$v['item_id']] += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
error_log("getChestItems start " . json_encode(
|
||||||
|
array(
|
||||||
|
'goods_id' => $goods_id,
|
||||||
|
'items' => array_keys($record),
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
$this->_rspData(
|
||||||
|
array(
|
||||||
|
'items' => array_keys($record),
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buyGoodsFree()
|
private function buyGoodsFree()
|
||||||
|
@ -97,6 +97,8 @@ class Item {
|
|||||||
const EMOJI_TYPE = 20;
|
const EMOJI_TYPE = 20;
|
||||||
const RANDOM_BOX_TYPE = 21;
|
const RANDOM_BOX_TYPE = 21;
|
||||||
|
|
||||||
|
const CHEST_BOX_TYPE = 23;
|
||||||
|
|
||||||
const FUNC_RENAME_CARD_SUBTYPE = 1;
|
const FUNC_RENAME_CARD_SUBTYPE = 1;
|
||||||
const MATERIAL_CHIP_SUBTYPE = 3;
|
const MATERIAL_CHIP_SUBTYPE = 3;
|
||||||
const DRUG_TILI_SUBTYPE = 4;
|
const DRUG_TILI_SUBTYPE = 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user