1
This commit is contained in:
parent
1d35055236
commit
2d0f82241a
@ -185,6 +185,7 @@ class BagController extends BaseAuthedController {
|
||||
return;
|
||||
}
|
||||
$costItems = mt\Item::getUseCostItems($itemMeta);
|
||||
error_log(json_encode($costItems));
|
||||
$lackItem = null;
|
||||
if (!$this->_hasEnoughItems($costItems, $lackItem)) {
|
||||
$this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
||||
|
@ -172,13 +172,11 @@ class Item {
|
||||
public static function getUseCostItems($itemMeta)
|
||||
{
|
||||
$costItems = array();
|
||||
$tmpStrs1 = splitStr1($itemMeta['use_cost']);
|
||||
foreach ($tmpStrs1 as $tmpStr1) {
|
||||
$tmpStrs2 = splitStr2($tmpStr1);
|
||||
if (count($tmpStrs2) >= 2) {
|
||||
foreach (splitStr2($itemMeta['use_cost']) as $arr) {
|
||||
if (count($arr) >= 2) {
|
||||
array_push($costItems, array(
|
||||
'item_id' => $tmpStrs2[0],
|
||||
'item_num' => $tmpStrs2[1]
|
||||
'item_id' => $arr[0],
|
||||
'item_num' => $arr[1]
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user