Merge branch 'hjb' of git.kingsome.cn:server/game2006api into hjb

This commit is contained in:
hujiabin 2023-08-22 16:15:23 +08:00
commit 0182702eae
4 changed files with 30 additions and 1 deletions

View File

@ -1198,6 +1198,7 @@ CREATE TABLE `t_bc_order` (
`order_type` int(11) NOT NULL COMMENT '0:默认',
`account_id` varchar(60) NOT NULL COMMENT '账户id 只用做事后分析用',
`address` varchar(60) COMMENT 'address',
`currency_name` varchar(60) NOT NULL COMMENT 'currency_name',
`status` int(11) NOT NULL DEFAULT '0' COMMENT '0: 支付中 1 已发货',
`item_id` int(11) NOT NULL COMMENT '道具id',
`item_num` bigint NOT NULL DEFAULT '0' COMMENT '道具数量',

View File

@ -71,7 +71,8 @@ CREATE TABLE `t_hash_rate_reward` (
KEY `account_id` (`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
alter table t_bc_order add column `currency_name` varchar(60) NOT NULL COMMENT 'currency_name';
insert into version (version) values(2023081601);
commit;
commit;

View File

@ -343,6 +343,7 @@ class BlockChainController extends BaseAuthedController {
'item_num' => $itemCount,
'order_type' => BcOrder::SPEC_ORDER_TYPE,
'price' => $num,
'currency_name' => $currency,
'ext_data' => json_encode(array(
'mode' => BcOrder::SHOP_BUY_MODE_NORMAL,
)),

View File

@ -61,6 +61,32 @@ class DynData extends BaseModel {
self::internalSetV($x, $y, $oldVal + $val);
}
public static function incVEx($accountId, $x, $y, $val)
{
$oldVal = self::getVEx($x, $y);
SqlHelper::upsert
(myself()->_getMysql($accountId),
't_dyndata',
array(
'account_id' => $accountId,
'x' => $x,
'y' => $y
),
array(
'val' => $oldVal + $val,
'modifytime' => myself()->_getNowTime()
),
array(
'account_id' => $accountId,
'x' => $x,
'y' => $y,
'val' => $val,
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime()
)
);
}
public static function decV($x, $y, $val)
{
self::incV($x, $y, 0 - $val);