1
This commit is contained in:
parent
4e3b199c2d
commit
299e0c7e84
@ -28,8 +28,8 @@ DROP TABLE IF EXISTS `t_box_order`;
|
|||||||
/*!40101 SET character_set_client = utf8 */;
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
CREATE TABLE `t_box_order` (
|
CREATE TABLE `t_box_order` (
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||||
`batch_id` int(11) NOT NULL DEFAULT '0' COMMENT '批次号',
|
|
||||||
`order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id',
|
`order_id` varchar(60) NOT NULL DEFAULT '' COMMENT '订单id',
|
||||||
|
`batch_id` int(11) NOT NULL DEFAULT '0' COMMENT '批次号',
|
||||||
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
`item_id` int(11) NOT NULL DEFAULT '0' COMMENT '道具id',
|
||||||
`state` int(11) NOT NULL DEFAULT '0' COMMENT 'state 0:待支付 1:支付成功',
|
`state` int(11) NOT NULL DEFAULT '0' COMMENT 'state 0:待支付 1:支付成功',
|
||||||
`bc_synced` int(11) NOT NULL DEFAULT '0' COMMENT '0:未上链 1:已上链',
|
`bc_synced` int(11) NOT NULL DEFAULT '0' COMMENT '0:未上链 1:已上链',
|
||||||
@ -44,7 +44,6 @@ CREATE TABLE `t_box_order` (
|
|||||||
`payment_token_address` varchar(60) NOT NULL DEFAULT '' COMMENT '货币地址',
|
`payment_token_address` varchar(60) NOT NULL DEFAULT '' COMMENT '货币地址',
|
||||||
`nonce` varchar(60) NOT NULL DEFAULT '' COMMENT 'nonce',
|
`nonce` varchar(60) NOT NULL DEFAULT '' COMMENT 'nonce',
|
||||||
`signature` varchar(255) NOT NULL DEFAULT '' COMMENT '签名',
|
`signature` varchar(255) NOT NULL DEFAULT '' COMMENT '签名',
|
||||||
`expired` int(11) NOT NULL DEFAULT '0' COMMENT '是否过期',
|
|
||||||
`done` int(11) NOT NULL DEFAULT '0' COMMENT '是否已完成',
|
`done` int(11) NOT NULL DEFAULT '0' COMMENT '是否已完成',
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||||
|
@ -10,7 +10,8 @@ class BoxOrder extends BaseModel {
|
|||||||
public function getSoldNum($batchId)
|
public function getSoldNum($batchId)
|
||||||
{
|
{
|
||||||
$row = myself()->_getMarketMysql()->execQueryOne
|
$row = myself()->_getMarketMysql()->execQueryOne
|
||||||
('SELECT COUNT(*) AS sold_num FROM t_box_order WHERE batch_id=:batch_id;',
|
('SELECT COUNT(*) AS sold_num FROM t_box_order WHERE batch_id=:batch_id AND ' .
|
||||||
|
' (state = 1 OR done <> 1);',
|
||||||
array(
|
array(
|
||||||
':batch_id' => $batchId
|
':batch_id' => $batchId
|
||||||
));
|
));
|
||||||
@ -20,7 +21,8 @@ class BoxOrder extends BaseModel {
|
|||||||
public function isBuyed($buyerAddress, $batchId)
|
public function isBuyed($buyerAddress, $batchId)
|
||||||
{
|
{
|
||||||
$row = myself()->_getMarketMysql()->execQueryOne
|
$row = myself()->_getMarketMysql()->execQueryOne
|
||||||
('SELECT COUNT(*) AS buy_count FROM t_box_order WHERE batch_id=:batch_id AND buyer_address=:buyer_address;',
|
('SELECT COUNT(*) AS buy_count FROM t_box_order WHERE batch_id=:batch_id AND ' .
|
||||||
|
' buyer_address=:buyer_address AND (state = 1 OR done <> 1);',
|
||||||
array(
|
array(
|
||||||
':buyer_address' => $buyerAddress,
|
':buyer_address' => $buyerAddress,
|
||||||
':batch_id' => $batchId
|
':batch_id' => $batchId
|
||||||
|
Loading…
x
Reference in New Issue
Block a user