|
@@ -113,7 +113,7 @@ class StoreProc {
|
|
|
|
|
|
$key = 3;
|
|
|
my_Assert(StlUtil::dictHasProperty(!ctx()->store(true)->storage, $key), ErrCode::store_expandStorage);
|
|
|
-
|
|
|
+
|
|
|
if($list[0] == 1){
|
|
|
my_Assert(ctx()->base(true)->gold >= $list[1], ErrCode::notenough_gold_msg);
|
|
|
ctx()->base(true)->Consume_Gold($list[1]);
|
|
@@ -121,11 +121,11 @@ class StoreProc {
|
|
|
my_Assert(ctx()->base(true)->cash >= $list[1], ErrCode::notenough_cash_msg);
|
|
|
ctx()->base(true)->Consume_Cash($list[1]);
|
|
|
}
|
|
|
-
|
|
|
+ $str = $list[0].",". $list[1];
|
|
|
ctx()->store(true)->storage->$key = array();
|
|
|
UserProc::updateUserInfo();
|
|
|
|
|
|
- return Resp::ok(array("storage"=>ctx()->store(true)->storage,));
|
|
|
+ return Resp::ok(array("storage"=>ctx()->store(true)->storage,"cost"=>$str,));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -140,17 +140,18 @@ class StoreProc {
|
|
|
$mo = GameConfig::shop_supplies_getItem($npcid, $itemid);
|
|
|
my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
|
|
|
+ $cost = $mo->cost * $num;
|
|
|
my_Assert($num <= $mo->num, ErrCode::err_const_no);
|
|
|
|
|
|
- my_Assert(ctx()->base(true)->gold >= $mo->cost * $num, ErrCode::notenough_gold_msg);
|
|
|
+ my_Assert(ctx()->base(true)->gold >= $cost, ErrCode::notenough_gold_msg);
|
|
|
|
|
|
- req()->userInfo->game->base(true)->Consume_Gold($mo->cost * $num);
|
|
|
+ req()->userInfo->game->base(true)->Consume_Gold($cost);
|
|
|
$goodsStr = $itemid . ',' . $num;
|
|
|
StoreProc::AddMultiItemInStore($goodsStr);
|
|
|
|
|
|
UserProc::updateUserInfo();
|
|
|
|
|
|
- return Resp::ok(array("store"=> ctx()->store(),));
|
|
|
+ return Resp::ok(array("store"=>ctx()->store(),"cost"=>$cost,));
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -215,7 +216,8 @@ class StoreProc {
|
|
|
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok(array(
|
|
|
- "store" => $store, # # 目前来看只涉及到items变化
|
|
|
+ "store" => $store,
|
|
|
+ "cost"=> $cost,
|
|
|
));
|
|
|
}
|
|
|
|