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