This commit is contained in:
songliang 2023-06-19 16:17:44 +08:00
parent d8637ee6ca
commit 33875275ec
3 changed files with 38 additions and 19 deletions

View File

@ -20,4 +20,6 @@ CREATE TABLE `t_bc_order` (
insert into version (version) values(2023061901); insert into version (version) values(2023061901);
alter table t_shop_buy_order change `account_id` `address` VARCHAR(60) NOT NULL COMMENT '账户地址';
alter table t_first_topup change `account_id` `address` VARCHAR(60) NOT NULL COMMENT '账户地址';
commit; commit;

View File

@ -20,6 +20,12 @@ class FirstTopupController extends BaseAuthedController
{ {
$complete = false; $complete = false;
$address = myself()->_getAddress();
if (!$address) {
$this->_rspErr(1, 'you have not a web3 address');
return;
}
$conn = myself()->_getMysql(''); $conn = myself()->_getMysql('');
$status = $this->getStatusFromDB($conn); $status = $this->getStatusFromDB($conn);
@ -43,11 +49,17 @@ class FirstTopupController extends BaseAuthedController
{ {
$conn = myself()->_getMysql(''); $conn = myself()->_getMysql('');
$address = myself()->_getAddress();
if (!$address) {
$this->_rspErr(1, 'you have not a web3 address');
return;
}
$exist = SqlHelper::selectOne( $exist = SqlHelper::selectOne(
$conn, $conn,
't_first_topup', 't_first_topup',
array('account_id'), array('address'),
array('account_id' => myself()->_getAccountId()) array('address' => myself()->_getAddress())
); );
if ($exist) { if ($exist) {
$this->_rspErr(1, '首充奖励活动已经开启'); $this->_rspErr(1, '首充奖励活动已经开启');
@ -59,7 +71,7 @@ class FirstTopupController extends BaseAuthedController
$conn, $conn,
't_first_topup', 't_first_topup',
array( array(
'account_id' => myself()->_getAccountId(), 'address' => myself()->_getAddress(),
'createtime' => myself()->_getNowTime(), 'createtime' => myself()->_getNowTime(),
'status1' => 0, 'status1' => 0,
'status2' => 0, 'status2' => 0,
@ -80,6 +92,12 @@ class FirstTopupController extends BaseAuthedController
$conn = myself()->_getMysql(''); $conn = myself()->_getMysql('');
$address = myself()->_getAddress();
if (!$address) {
$this->_rspErr(1, 'you have not a web3 address');
return;
}
$status = $this->getStatusFromDB($conn); $status = $this->getStatusFromDB($conn);
$test = $status[$group - 1]; $test = $status[$group - 1];
@ -90,7 +108,7 @@ class FirstTopupController extends BaseAuthedController
$conn, $conn,
't_first_topup', 't_first_topup',
array( array(
'account_id' => myself()->_getAccountId(), 'address' => myself()->_getAddress(),
), ),
array( array(
'status' . $group => 2, 'status' . $group => 2,
@ -122,10 +140,9 @@ class FirstTopupController extends BaseAuthedController
) )
); );
} else if ($test >= 2) { } else if ($test >= 2) {
$this->_rspErr(2, "already received the reward"); $this->_rspErr(2, "already received the reward, group: $group");
} else if ($test < 1) { } else if ($test < 1) {
// 未到领取时间 英文 怎么说 $this->_rspErr(1, "not yet to receive the reward, group: $group");
$this->_rspErr(1, "not yet to receive the reward");
} }
} }
@ -149,7 +166,7 @@ class FirstTopupController extends BaseAuthedController
$conn, $conn,
't_first_topup', 't_first_topup',
array('createtime', 'status1', 'status2', 'status3'), array('createtime', 'status1', 'status2', 'status3'),
array('account_id' => myself()->_getAccountId()) array('address' => myself()->_getAddress())
); );
$status = [0, 0, 0]; $status = [0, 0, 0];

View File

@ -418,6 +418,8 @@ class ShopController extends BaseAuthedController
'order_id' => $lastId, 'order_id' => $lastId,
) )
); );
} else {
$this->_rspErr(1, "insert error, id: {$id}, token_type: {$token_type}, goods_num: {$goods_num}");
} }
} }
@ -442,11 +444,7 @@ class ShopController extends BaseAuthedController
) )
); );
} else { } else {
$this->_rspData( $this->_rspErr(1, "order_id not found, order_id: {$order_id}");
array(
'status' => 0,
)
);
} }
} }
@ -789,7 +787,8 @@ class ShopController extends BaseAuthedController
); );
} }
public function buyGoodsDS() { public function buyGoodsDS()
{
$account = $this->_getAccountId(); $account = $this->_getAccountId();
$idx = getReqVal('idx', 0); $idx = getReqVal('idx', 0);
$grid = getReqVal('grid', 0); $grid = getReqVal('grid', 0);
@ -842,7 +841,8 @@ class ShopController extends BaseAuthedController
return $chk; return $chk;
} }
private function clearBeforeTodayDailySelections() { private function clearBeforeTodayDailySelections()
{
$self = myself(); $self = myself();
if (!$self) return; if (!$self) return;
@ -1210,8 +1210,8 @@ class ShopController extends BaseAuthedController
$exist = SqlHelper::selectOne( $exist = SqlHelper::selectOne(
$conn, $conn,
't_first_topup', 't_first_topup',
array('account_id'), array('address'),
array('account_id' => myself()->_getAccountId()) array('address' => myself()->_getAddress())
); );
if ($exist) { if ($exist) {
return; return;
@ -1222,7 +1222,7 @@ class ShopController extends BaseAuthedController
$conn, $conn,
't_first_topup', 't_first_topup',
array( array(
'account_id' => myself()->_getAccountId(), 'address' => myself()->_getAddress(),
'createtime' => myself()->_getNowTime(), 'createtime' => myself()->_getNowTime(),
'status1' => 0, 'status1' => 0,
'status2' => 0, 'status2' => 0,