Commit f928ae53 authored by shajiaiming's avatar shajiaiming

fix

parent d75af376
......@@ -52,7 +52,7 @@ class IssueCoinController extends BaseController
'type' => isset($result['type']) ? $result['type'] : 0,
'platform_id' => $platform_id,
'chain_id' => $chain_id,
'charge_unit_id' => isset($result['charge_unit_id']) ? $result['charge_unit_id'] : '',
'charge_unit' => isset($result['charge_unit']) ? $result['charge_unit'] : '',
'charge' => $coin_platform->issue_charge,
];
$model = new CoinIssueCoin();
......@@ -129,7 +129,7 @@ class IssueCoinController extends BaseController
'type' => isset($result['type']) ? $result['type'] : 0,
'platform_id' => $platform_id,
'chain_id' => $chain_id,
'charge_unit_id' => isset($result['charge_unit_id']) ? $result['charge_unit_id'] : '',
'charge_unit' => isset($result['charge_unit']) ? $result['charge_unit'] : '',
'charge' => $coin_platform->issue_charge,
];
$model->load($result, '');
......@@ -234,7 +234,6 @@ class IssueCoinController extends BaseController
$data->total = (int)$data->total * 1e8;
$data->chain_name = $data->chain->platform;
$data->issue_charge = rtrim(sprintf('%.3f', floatval($data->charge)), '0');
$data->charge_unit = isset($data->platform->charge_unit) ? $data->platform->charge_unit : '';
$code = 0;
$msg = 'success';
if (CoinIssueCoin::STATUS_FAILED == $data->status) {
......
......@@ -46,9 +46,9 @@ class CoinIssueCoin extends CommonActiveRecord
public function rules()
{
return [
[['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit_id', 'charge'], 'required'],
[['total', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit_id'], 'integer'],
['introduction', 'string', 'length' => [1, 20]],
[['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit', 'charge'], 'required'],
[['total', 'category', 'type', 'platform_id', 'chain_id'], 'integer'],
[['introduction','charge_unit'], 'string', 'length' => [1, 20]],
['symbol', 'string', 'length' => [1, 6]],
['name', 'string', 'length' => [1, 20]],
#['status', 'in', 'range' => [1, 2, 0]],
......@@ -61,7 +61,7 @@ class CoinIssueCoin extends CommonActiveRecord
public function scenarios()
{
$scenarios = [
self:: SCENARIOS_CREATE => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit_id', 'charge'],
self:: SCENARIOS_CREATE => ['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit', 'charge'],
self:: SCENARIOS_UPDATE => ['status'],
self:: SCENARIOS_CANCEL => ['status'],
];
......@@ -148,13 +148,13 @@ class CoinIssueCoin extends CommonActiveRecord
'chain_id' => '平行链名称',
'msg' => '失败原因',
'status' => '状态',
'charge_unit_id' => '手续费',
'charge_unit' => '手续费',
];
}
public function attributes()
{
return array_merge(parent::attributes(), ['issue_charge', 'charge_unit', 'url', 'chain_name']);
return array_merge(parent::attributes(), ['issue_charge', 'url', 'chain_name']);
}
/**
......
......@@ -29,12 +29,12 @@ class IssueCoinController extends BaseController
$chain_id = \Yii::$app->request->get('chain_id', '');
if (1 == $platform_id) {
$query = CoinIssueCoin::find()
->select('id, name, total, status, chain_id, charge_unit_id, charge, platform_id, owner, category, type, symbol, introduction, create_time')
->select('id, name, total, status, chain_id, charge_unit, charge, platform_id, owner, category, type, symbol, introduction, create_time')
->where(['in', 'status', [CoinIssueCoin::STATUS_CONFIRM, CoinIssueCoin::STATUS_ALLOW, CoinIssueCoin::STATUS_REFUSE, CoinIssueCoin::STATUS_SUCCESS, CoinIssueCoin::STATUS_FAILED]])
->orderBy('create_time desc');
} else {
$query = CoinIssueCoin::find()
->select('id, name, total, status, chain_id, charge_unit_id, charge, platform_id, owner, category, type, symbol, introduction, create_time')
->select('id, name, total, status, chain_id, charge_unit, charge, platform_id, owner, category, type, symbol, introduction, create_time')
->where(['platform_id' => $platform_id])
->andWhere(['in', 'status', [CoinIssueCoin::STATUS_CONFIRM, CoinIssueCoin::STATUS_ALLOW, CoinIssueCoin::STATUS_REFUSE, CoinIssueCoin::STATUS_SUCCESS, CoinIssueCoin::STATUS_FAILED]])
->orderBy('create_time desc');
......@@ -60,7 +60,6 @@ class IssueCoinController extends BaseController
foreach ($models as &$val) {
$platform = isset($val->chain->platform) ? $val->chain->platform : '';
$val->chain_name = $platform;
$val->charge_unit = isset($val->gas->coin_name) ? $val->gas->coin_name : '';
$val->url = Yii::$app->redis->hget('platform_brower_info', $platform);
$val->total = (int)$val->total * 1e8;
}
......@@ -98,7 +97,6 @@ class IssueCoinController extends BaseController
$platform = isset($data->chain->platform) ? $data->chain->platform : '';
$data->total = (int)$data->total * 1e8;
$data->issue_charge = rtrim(sprintf('%.3f', floatval($data->charge)), '0');
$data->charge_unit = isset($data->gas->coin_name) ? $data->gas->coin_name : '';
$data->url = Yii::$app->redis->hget('platform_brower_info', $platform);
$code = 0;
$msg = 'success';
......
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