Commit 8cb1008d authored by shajiaiming's avatar shajiaiming

fix

parent a736d41f
...@@ -54,10 +54,11 @@ class IssueCoinController extends BaseController ...@@ -54,10 +54,11 @@ class IssueCoinController extends BaseController
'chain_id' => $chain_id, 'chain_id' => $chain_id,
'charge_unit' => isset($result['charge_unit']) ? $result['charge_unit'] : '', 'charge_unit' => isset($result['charge_unit']) ? $result['charge_unit'] : '',
'charge' => $coin_platform->issue_charge, 'charge' => $coin_platform->issue_charge,
'token_type' => isset($result['token_type']) ? $result['token_type'] : 0,
'nickname' => isset($result['nickname']) ? $result['nickname'] : ''
]; ];
$model = new CoinIssueCoin(); $model = new CoinIssueCoin();
if (35 == $platform_id) { if (35 == $platform_id) {
$result['token_type'] = isset($result['token_type']) ? $result['token_type'] : 0;
$model->setScenario(CoinIssueCoin::SCENARIOS_CREATE_MALL); $model->setScenario(CoinIssueCoin::SCENARIOS_CREATE_MALL);
} else { } else {
$model->setScenario(CoinIssueCoin::SCENARIOS_CREATE); $model->setScenario(CoinIssueCoin::SCENARIOS_CREATE);
...@@ -121,11 +122,8 @@ class IssueCoinController extends BaseController ...@@ -121,11 +122,8 @@ class IssueCoinController extends BaseController
$code = -1; $code = -1;
goto doEnd; goto doEnd;
} }
foreach (Yii::$app->params['lang'] as $key => $val) {
$name[$val] = isset($result[$val]) ? $result[$val] : '';
}
$result = [ $result = [
'name' => $name, 'name' => isset($result['name']) ? $result['name'] : '',
'symbol' => isset($result['symbol']) ? strtoupper($result['symbol']) : '', 'symbol' => isset($result['symbol']) ? strtoupper($result['symbol']) : '',
'total' => isset($result['total']) ? $result['total'] : '', 'total' => isset($result['total']) ? $result['total'] : '',
'owner' => isset($result['owner']) ? $result['owner'] : '', 'owner' => isset($result['owner']) ? $result['owner'] : '',
...@@ -135,11 +133,12 @@ class IssueCoinController extends BaseController ...@@ -135,11 +133,12 @@ class IssueCoinController extends BaseController
'platform_id' => $platform_id, 'platform_id' => $platform_id,
'chain_id' => $chain_id, 'chain_id' => $chain_id,
'charge_unit' => isset($result['charge_unit']) ? $result['charge_unit'] : '', 'charge_unit' => isset($result['charge_unit']) ? $result['charge_unit'] : '',
'charge' => (CoinIssueCoin::TYPE_NO == $result['type']) ? $coin_platform->issue_charge : 0, 'charge' => isset($result['type']) ? ((CoinIssueCoin::TYPE_NO == $result['type']) ? $coin_platform->issue_charge : 0) : 0,
'token_type' => isset($result['token_type']) ? $result['token_type'] : 0,
'nickname' => isset($result['nickname']) ? $result['nickname'] : ''
]; ];
$model = new CoinIssueCoin(); $model = new CoinIssueCoin();
if (35 == $platform_id) { if (35 == $platform_id) {
$result['token_type'] = isset($result['token_type']) ? $result['token_type'] : 0;
$model->setScenario(CoinIssueCoin::SCENARIOS_CREATE_MALL); $model->setScenario(CoinIssueCoin::SCENARIOS_CREATE_MALL);
} else { } else {
$model->setScenario(CoinIssueCoin::SCENARIOS_CREATE); $model->setScenario(CoinIssueCoin::SCENARIOS_CREATE);
...@@ -204,7 +203,6 @@ class IssueCoinController extends BaseController ...@@ -204,7 +203,6 @@ class IssueCoinController extends BaseController
$models = $query->offset(($page - 1) * $size)->limit($size)->all(); $models = $query->offset(($page - 1) * $size)->limit($size)->all();
$pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $size]); $pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $size]);
foreach ($models as &$val) { foreach ($models as &$val) {
$val->name = isset($val->name['en-US']) ? $val->name['en-US'] : '';
$val->chain_id = $val->chain->platform; $val->chain_id = $val->chain->platform;
$val->total = (int)$val->total * 1e4; $val->total = (int)$val->total * 1e4;
} }
...@@ -244,7 +242,6 @@ class IssueCoinController extends BaseController ...@@ -244,7 +242,6 @@ class IssueCoinController extends BaseController
$code = -1; $code = -1;
goto doEnd; goto doEnd;
} }
$data->name = $data->name['en-US'];
$data->total = (int)$data->total * 1e4; $data->total = (int)$data->total * 1e4;
$data->chain_name = $data->chain->platform; $data->chain_name = $data->chain->platform;
$data->issue_charge = rtrim(sprintf('%.3f', floatval($data->charge)), '0'); $data->issue_charge = rtrim(sprintf('%.3f', floatval($data->charge)), '0');
......
...@@ -52,7 +52,8 @@ class CoinIssueCoin extends CommonActiveRecord ...@@ -52,7 +52,8 @@ class CoinIssueCoin extends CommonActiveRecord
[['introduction', 'charge_unit'], 'string', 'length' => [1, 20]], [['introduction', 'charge_unit'], 'string', 'length' => [1, 20]],
['symbol', 'string', 'length' => [1, 6]], ['symbol', 'string', 'length' => [1, 6]],
['name', 'string', 'length' => [1, 20]], ['name', 'string', 'length' => [1, 20]],
['token_type', 'safe'], ['nickname', 'string', 'length' => [0, 10]],
[['token_type', 'nickname'], 'safe'],
#['status', 'in', 'range' => [1, 2, 0]], #['status', 'in', 'range' => [1, 2, 0]],
['name', 'verfiyName'], ['name', 'verfiyName'],
['symbol', 'verfiySymbol'], ['symbol', 'verfiySymbol'],
...@@ -63,8 +64,8 @@ class CoinIssueCoin extends CommonActiveRecord ...@@ -63,8 +64,8 @@ class CoinIssueCoin extends CommonActiveRecord
public function scenarios() public function scenarios()
{ {
$scenarios = [ $scenarios = [
self:: SCENARIOS_CREATE => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit', 'charge'], self:: SCENARIOS_CREATE => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit', 'charge', 'token_type', 'nickname'],
self:: SCENARIOS_CREATE_MALL => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'token_type'], self:: SCENARIOS_CREATE_MALL => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'token_type', 'nickname'],
self:: SCENARIOS_UPDATE => ['status'], self:: SCENARIOS_UPDATE => ['status'],
self:: SCENARIOS_CANCEL => ['status'], self:: SCENARIOS_CANCEL => ['status'],
]; ];
......
...@@ -256,6 +256,7 @@ class IssueChainTransferController extends Controller ...@@ -256,6 +256,7 @@ class IssueChainTransferController extends Controller
if (CoinIssueCoin::TYPE_YES == $val->coin->type) { if (CoinIssueCoin::TYPE_YES == $val->coin->type) {
$params = [ $params = [
'name' => $val->coin->name, 'name' => $val->coin->name,
'nickname' => $val->nickname,
'symbol' => $val->coin->symbol, 'symbol' => $val->coin->symbol,
'introduction' => $val->coin->introduction, 'introduction' => $val->coin->introduction,
'total' => (int)$val->coin->total, 'total' => (int)$val->coin->total,
...@@ -277,6 +278,7 @@ class IssueChainTransferController extends Controller ...@@ -277,6 +278,7 @@ class IssueChainTransferController extends Controller
if (CoinIssueCoin::TYPE_NO == $val->coin->type) { if (CoinIssueCoin::TYPE_NO == $val->coin->type) {
$params = [ $params = [
'name' => $val->coin->name, 'name' => $val->coin->name,
'nickname' => $val->nickname,
'symbol' => $val->coin->symbol, 'symbol' => $val->coin->symbol,
'introduction' => $val->coin->introduction, 'introduction' => $val->coin->introduction,
'total' => (int)$val->coin->total, 'total' => (int)$val->coin->total,
...@@ -373,8 +375,8 @@ class IssueChainTransferController extends Controller ...@@ -373,8 +375,8 @@ class IssueChainTransferController extends Controller
if (false == $model_coin) { if (false == $model_coin) {
$model = new Coin(); $model = new Coin();
$model->name = $params['symbol']; $model->name = $params['symbol'];
$model->sid = isset($params['name']['en-US']) ? $params['name']['en-US'] : ''; $model->sid = $params['name'];
$model->nickname = $params['name']; $model->nickname = ['ja' => '', 'en-US' => '', 'zh-CN' => $params['nickname']];
$model->platform = $params['platform']; $model->platform = $params['platform'];
$model->publish_count = $params['total'] * 1e4; $model->publish_count = $params['total'] * 1e4;
$model->chain = 'BTY'; $model->chain = 'BTY';
......
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