Commit e60d2a74 authored by shajiaiming's avatar shajiaiming

fix

parent 06fdd5d0
......@@ -70,10 +70,7 @@ class IssueCoinController extends BaseController
$msg = 'ok';
$code = 0;
$data = $model->getPrimaryKey();
$coin_issue_record = new CoinIssueRecord();
$coin_issue_record->platform_id = $platform_id;
$coin_issue_record->total = $result['total'];
$coin_issue_record->save();
doEnd :
return ['code' => $code, 'msg' => $msg, 'data' => $data];
}
......
......@@ -4,6 +4,7 @@ namespace console\controllers;
use common\models\psources\Coin;
use common\models\psources\CoinIssueCoin;
use common\models\psources\CoinIssueRecord;
use common\models\psources\CoinIssueTransfer;
use common\service\chain33\Chain33Service;
use Yii;
......@@ -134,8 +135,10 @@ class IssueCoinController extends Controller
$result = $chain_service->createRawTokenPreCreateTx($params);
if (null == $result['error'] && false == $result['code']) {
$status = CoinIssueCoin::SUCCESS_ISSUE;
$params['platform_id'] = $issue_coin_model->platform_id;
$params['platform'] = $issue_coin_model->chain->platform;
$this->syncTransfer($issue_transfer['id']);
$this->syncRecord($params);
$this->syncCoin($params);
} else {
$status = CoinIssueCoin::FAIL_ISSUE;
......@@ -167,6 +170,14 @@ class IssueCoinController extends Controller
}
}
public function syncRecord($params = [])
{
$coin_issue_record = new CoinIssueRecord();
$coin_issue_record->platform_id = $params['platform_id'];
$coin_issue_record->total = $params['total'];
$coin_issue_record->save();
}
public function syncTransfer($id)
{
$issue_transfer = CoinIssueTransfer::find()->where(['id' => $id])->one();
......
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