This commit is contained in:
aozhiwei 2024-06-10 17:32:49 +08:00
parent 15d2bcf801
commit 556b5e42cb
3 changed files with 78 additions and 1 deletions

View File

@ -1764,7 +1764,7 @@ CREATE TABLE `t_gold_bullion` (
`net_id` int(11) NOT NULL DEFAULT '0' COMMENT '链id', `net_id` int(11) NOT NULL DEFAULT '0' COMMENT '链id',
`gold` bigint NOT NULL DEFAULT '0' COMMENT '金币', `gold` bigint NOT NULL DEFAULT '0' COMMENT '金币',
`address` varchar(60) COMMENT 'address', `address` varchar(60) COMMENT 'address',
`status` int(11) NOT NULL DEFAULT '0' COMMENT '状态 0:初始 1:超时已领取', `status` int(11) NOT NULL DEFAULT '0' COMMENT '状态 0:初始 1:已打开',
`returned` int(11) NOT NULL DEFAULT '0' COMMENT '是否已超时返还', `returned` int(11) NOT NULL DEFAULT '0' COMMENT '是否已超时返还',
`return_time` int(11) NOT NULL DEFAULT '0' COMMENT '返还时间', `return_time` int(11) NOT NULL DEFAULT '0' COMMENT '返还时间',
`activated` int(11) NOT NULL DEFAULT '0' COMMENT '是否已上连', `activated` int(11) NOT NULL DEFAULT '0' COMMENT '是否已上连',
@ -1778,3 +1778,37 @@ CREATE TABLE `t_gold_bullion` (
KEY `idx_address_createtime_activate_status` (`address`, `createtime`, `activate`, `status`) KEY `idx_address_createtime_activate_status` (`address`, `createtime`, `activate`, `status`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `t_gold_bullion`
--
DROP TABLE IF EXISTS `t_gold_bullion`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_gold_bullion` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`src_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`src_address` varchar(60) COMMENT 'src_address',
`token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
`net_id` int(11) NOT NULL DEFAULT '0' COMMENT '链id',
`gold` bigint NOT NULL DEFAULT '0' COMMENT '金币',
`status` int(11) NOT NULL DEFAULT '0' COMMENT '状态 0:初始 1:已开',
`open_status` int(11) NOT NULL DEFAULT '0' COMMENT '1: 已发送 2未发送 3:已领取',
`open_address` varchar(60) COMMENT 'open_address',
`open_time` int(11) NOT NULL DEFAULT '0' COMMENT 'open_time',
`open_account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`open_try_count` int(11) NOT NULL DEFAULT '0' COMMENT 'open_try_count',
`returned` int(11) NOT NULL DEFAULT '0' COMMENT '是否已超时返还',
`return_time` int(11) NOT NULL DEFAULT '0' COMMENT '返还时间',
`activated` int(11) NOT NULL DEFAULT '0' COMMENT '是否已上连',
`activate_time` int(11) NOT NULL DEFAULT '0' COMMENT '上链成功时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `idx_token_id` (`token_id`),
UNIQUE KEY `idx_token_id_net_id` (`token_id`, `net_id`),
KEY `idx_open_address_open_status` (`open_address`, `open_status`),
KEY `idx_address_createtime_activate_status` (`address`, `createtime`, `activate`, `status`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

View File

@ -0,0 +1,27 @@
<?php
namespace models;
class GoldBullion extends BaseModel {
const OPEN_STATUS_SENT = 1;
const OPEN_STATUS_PENDING = 2;
const OPEN_STATUS_SEND_BEGIN = 3;
const OPEN_STATUS_SEND_END = 4;
public static function onLogin()
{
$rows = SqlHelper::ormSelect(
myself()->_getSelfMysql(),
't_gold_bullion',
array(
'open_address' => myself()->_getAddress(),
'open_status' => self::OPEN_STATUS_PENDING,
)
);
if (count($rows) > 0) {
}
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace services;
require_once('models/GoldBullion.php');
use models\GoldBullion;
class LoginService extends BaseService {
public function onLogon()
{
GoldBullion::onLogin();
}
}