|
@@ -81,7 +81,7 @@ class Exchange extends Api
|
|
|
if (!$welfare_config) $this->error(__('Invalid parameters'));
|
|
if (!$welfare_config) $this->error(__('Invalid parameters'));
|
|
|
//检查是否在开启时间之内
|
|
//检查是否在开启时间之内
|
|
|
if(time() < $welfare_config['start_time'] || time() > $welfare_config['end_time']) $this->error(__('不在兑换时间范围内'));
|
|
if(time() < $welfare_config['start_time'] || time() > $welfare_config['end_time']) $this->error(__('不在兑换时间范围内'));
|
|
|
- /*
|
|
|
|
|
|
|
+
|
|
|
//检查是否已兑换过
|
|
//检查是否已兑换过
|
|
|
if($welfare_config['limit_num'] > 0){
|
|
if($welfare_config['limit_num'] > 0){
|
|
|
$check_user = (new RwaExchangeRecordModel())
|
|
$check_user = (new RwaExchangeRecordModel())
|
|
@@ -183,14 +183,13 @@ class Exchange extends Api
|
|
|
|
|
|
|
|
//记录
|
|
//记录
|
|
|
$inster_data['tx_hash_usdt'] = $usdt_data['hash'];
|
|
$inster_data['tx_hash_usdt'] = $usdt_data['hash'];
|
|
|
- Log::info($inster_data, '插入数据');*/
|
|
|
|
|
|
|
+ Log::info($inster_data, '插入数据');
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
Db::startTrans();
|
|
Db::startTrans();
|
|
|
- //$rs = Db::name('rwa_exchange_record')->fetchSql(false)->insert($inster_data);
|
|
|
|
|
- //Log::info($rs, '插入状态');
|
|
|
|
|
- $usdt_data['amount'] = 100;
|
|
|
|
|
- $order_no = date('YmdHis') . rand(1000, 9999);
|
|
|
|
|
|
|
+ $rs = Db::name('rwa_exchange_record')->fetchSql(false)->insert($inster_data);
|
|
|
|
|
+ Log::info($rs, '插入状态');
|
|
|
|
|
+
|
|
|
//添加标记茶宝记录
|
|
//添加标记茶宝记录
|
|
|
$ledgerWalletModel->changeWalletAccount($this->auth->id, Asset::FROZEN, $usdt_data['amount'], LedgerFrozenChangeModel::RwaExchangeRecord, 0);
|
|
$ledgerWalletModel->changeWalletAccount($this->auth->id, Asset::FROZEN, $usdt_data['amount'], LedgerFrozenChangeModel::RwaExchangeRecord, 0);
|
|
|
|
|
|