Commit ed72c0af authored by rlgy's avatar rlgy

保持提币交易信息

parent e61a5cd5
......@@ -18,6 +18,7 @@ use backend\jobs\QueryTransJob;
* @property integer $uid
* @property integer $mid
* @property integer $list_id
* @property string $txhash
* @property string $mobile
* @property string $coin
* @property double $amount
......@@ -74,6 +75,7 @@ class CoinReleaseCheck extends BaseActiveRecord
'id' => 'ID',
'uid' => 'UID',
'list_id' => '记录ID',
'txhash' => '交易txhash',
'mobile' => '手机',
'coin' => '币种',
'to_address' => '对方地址',
......@@ -151,31 +153,32 @@ class CoinReleaseCheck extends BaseActiveRecord
$this->check_second_uid = Yii::$app->user->id;
$this->check_second_status = $status;
$this->status = self::STATUS_PADDING;
//区块链转币
if (strtoupper($this->coin) == 'BTY') {
$isToken = false;
} else {
$isToken = true;
}
$result = Chain33Business::transToken(
trim($address),
trim($this->to_address),
(int)$this->amount,
"锁仓释放",
$isToken,
$this->coin
);
if (is_array($result)) {
$trans->rollBack();
throw new \Exception(Yii::t('backend', $result['msg']), $result['code']);
}
$this->txhash = $result;
if ($this->save(false)) {
//区块链转币
if (strtoupper($this->coin) == 'BTY') {
$isToken = false;
} else {
$isToken = true;
}
$result = Chain33Business::transToken(
trim($address),
trim($this->to_address),
(int)$this->amount,
"锁仓释放",
$isToken,
$this->coin
);
if (is_array($result)) {
$trans->rollBack();
throw new \Exception(Yii::t('backend', $result['msg']), $result['code']);
}
$trans->commit();
Yii::$app->queue->delay(15)->push(new QueryTransJob([
'txhash' => $result,
'lid' => $this->list_id,
'cid' => $this->id
]));
$trans->commit();
return true;
} else {
throw new \Exception('修改审核状态失败', -1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment