Merge branch 'star' of git.kingsome.cn:server/game2006api into star
This commit is contained in:
commit
ea2a24e87e
@ -557,6 +557,7 @@ class HeroController extends BaseAuthedController {
|
||||
BcOrder::upsert($response['trans_id'], array(
|
||||
'item_id' => V_ITEM_RESET_CARD,
|
||||
'item_num' => 1,
|
||||
'price' => $price,
|
||||
'ext_data' => json_encode($hero_unnid),
|
||||
));
|
||||
$this->_rspData($response);
|
||||
|
@ -763,7 +763,13 @@ class MarketController extends BaseAuthedController
|
||||
$job_filters = getReqVal('job_filters', '');
|
||||
$job_filter_array = explode('|', $job_filters);
|
||||
$search_filters = getReqVal('search_filters', '');
|
||||
$search_filter_array = explode('|', $search_filters);
|
||||
error_log('search_filters:' . $search_filters);
|
||||
if ($search_filters != '') {
|
||||
$search_filter_array = explode('|', $search_filters);
|
||||
} else {
|
||||
$search_filter_array = array();
|
||||
}
|
||||
|
||||
$lv_filter = getReqVal('lv_filter', 0);
|
||||
$quality_filter = getReqVal('quality_filter', 0);
|
||||
$durability_filter = getReqVal('durability_filter', 0);
|
||||
@ -816,12 +822,14 @@ class MarketController extends BaseAuthedController
|
||||
};
|
||||
$search_filter_fn = function ($f) {
|
||||
$str = '';
|
||||
error_log('search_filter ' . json_encode($f));
|
||||
$arr_options = array();
|
||||
foreach ($f as $v) {
|
||||
if (!empty($v)) {
|
||||
array_push($arr_options, 'c_name=\'' . $v . '\' OR token_id=\'' . $v . '\' ');
|
||||
}
|
||||
}
|
||||
error_log('$$search_filter ' . json_encode($arr_options));
|
||||
if (count($arr_options) > 0) {
|
||||
$str = implode('OR ', $arr_options);
|
||||
$str = 'AND (' . $str . ') ';
|
||||
@ -952,6 +960,7 @@ class MarketController extends BaseAuthedController
|
||||
}
|
||||
|
||||
$search_filters = getReqVal('search_filters', '');
|
||||
error_log('search_filters:' . $search_filters);
|
||||
if ($search_filters != '') {
|
||||
$search_filter_array = explode('|', $search_filters);
|
||||
} else {
|
||||
@ -1165,9 +1174,10 @@ class MarketController extends BaseAuthedController
|
||||
$this->_rspErr(1, 'goods not found, idx:' . $idx);
|
||||
return;
|
||||
}
|
||||
|
||||
$response = services\BlockChainService::gameItemMallBuy(
|
||||
|
||||
$response = services\BlockChainService::gameItemMarketBuy(
|
||||
Transaction::BUY_GOODS_FROM_MARKET_ACTION_TYPE,
|
||||
$goods['owner_address'],
|
||||
$goods['s_price'],
|
||||
$goods['item_id'],
|
||||
$goods['amount']
|
||||
@ -1190,6 +1200,7 @@ class MarketController extends BaseAuthedController
|
||||
'item_id' => $item_id,
|
||||
'item_num' => $item_count,
|
||||
'order_type' => 1,
|
||||
'price' => $goods['s_price'],
|
||||
'ext_data' => json_encode(array(
|
||||
'mode' => SHOP_BUY_MODE_NORMAL,
|
||||
)),
|
||||
|
@ -213,6 +213,7 @@ class PassController extends BaseAuthedController
|
||||
BcOrder::upsert($response['trans_id'], array(
|
||||
'item_id' => V_ITEM_PASS,
|
||||
'item_num' => 1,
|
||||
'price' => $price,
|
||||
));
|
||||
$this->_rspData($response);
|
||||
}
|
||||
@ -242,6 +243,7 @@ class PassController extends BaseAuthedController
|
||||
BcOrder::upsert($response['trans_id'], array(
|
||||
'item_id' => V_ITEM_EXP,
|
||||
'item_num' => $passMeta['total_exp'] - $this->userInfo['exp'],
|
||||
'price' => $price,
|
||||
));
|
||||
$this->_rspData($response);
|
||||
}
|
||||
|
@ -667,6 +667,7 @@ class ShopController extends BaseAuthedController
|
||||
'item_id' => $item_id,
|
||||
'item_num' => $item_count,
|
||||
'order_type' => 1,
|
||||
'price' => $goods_num * $need_price,
|
||||
'ext_data' => json_encode(array(
|
||||
'mode' => SHOP_BUY_MODE_NORMAL,
|
||||
'shop_id' => $row['shop_id'],
|
||||
@ -707,6 +708,8 @@ class ShopController extends BaseAuthedController
|
||||
$item_id = V_ITEM_DIAMOND;
|
||||
$item_count = $num;
|
||||
|
||||
error_log("buy diamond start " . $num);
|
||||
|
||||
$response = services\BlockChainService::gameItemMallBuy(
|
||||
Transaction::BUY_GOODS_ACTION_TYPE,
|
||||
$price,
|
||||
@ -718,6 +721,7 @@ class ShopController extends BaseAuthedController
|
||||
'item_id' => $item_id,
|
||||
'item_num' => $item_count,
|
||||
'order_type' => 1,
|
||||
'price' => $num,
|
||||
'ext_data' => json_encode(array(
|
||||
'mode' => SHOP_BUY_MODE_NORMAL,
|
||||
)),
|
||||
@ -909,6 +913,7 @@ class ShopController extends BaseAuthedController
|
||||
'item_id' => $item_id,
|
||||
'item_num' => $item_count,
|
||||
'order_type' => 1,
|
||||
'price' => $goods['price'] * $count,
|
||||
'ext_data' => json_encode(array(
|
||||
'mode' => SHOP_BUY_MODE_DAILY_SELECTION,
|
||||
'idx' => $idx,
|
||||
|
@ -30,6 +30,7 @@ class BcOrder
|
||||
'ext_data' => getXVal($fieldsKv,'ext_data',''),
|
||||
'createtime' => myself()->_getNowTime(),
|
||||
'modifytime' => myself()->_getNowTime(),
|
||||
'price' => $fieldsKv['price'],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ class BlockChainService {
|
||||
c
|
||||
*/
|
||||
|
||||
public static function gameItemMarketBuy($actionType, $price, $itemId, $itemNum)
|
||||
public static function gameItemMarketBuy($actionType, $owner_address, $price, $itemId, $itemNum)
|
||||
{
|
||||
if (!($actionType > Transaction::BUY_BEGIN_ACTION_TYPE &&
|
||||
$actionType < Transaction::BUY_END_ACTION_TYPE)) {
|
||||
@ -118,6 +118,7 @@ class BlockChainService {
|
||||
'a' => 'buy',
|
||||
'account' => $account,
|
||||
'price' => $price,
|
||||
'owner_address' => $owner_address,
|
||||
);
|
||||
{
|
||||
$url = self::getWeb3ServiceUrl();
|
||||
|
@ -76,13 +76,17 @@ class BuyShopGoodsCbService
|
||||
$address = $order['address'];
|
||||
$item_id = $order['item_id'];
|
||||
$item_num = $order['item_num'];
|
||||
$id = null;
|
||||
if (isset($ext_data['id'])) {
|
||||
$id = $ext_data['id'];
|
||||
}
|
||||
|
||||
error_log("callback buynormal address: $address, order_id: $order_id, goods_id: $item_id, goods_num: $item_num");
|
||||
|
||||
$this->_addGoods($address, array(
|
||||
'goods_id' => $item_id,
|
||||
'goods_num' => $item_num,
|
||||
'id' => $ext_data['id'],
|
||||
'id' => $id,
|
||||
));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user