Commit 2bac09cd authored by shajiaiming's avatar shajiaiming

fix

parent c1bc9042
...@@ -129,14 +129,14 @@ class CoinIssueCoin extends CommonActiveRecord ...@@ -129,14 +129,14 @@ class CoinIssueCoin extends CommonActiveRecord
public function verfiyAmount($attribute, $params) public function verfiyAmount($attribute, $params)
{ {
if (CoinIssueCoin::TYPE_YES == $this->type) { if (CoinIssueCoin::TYPE_YES == $this->type) {
if ($this->$attribute > 10) { if ($this->$attribute > (10 * 1e4)) {
$this->addError($attribute, '增发发行量不能超过10亿'); $this->addError($attribute, '增发发行量不能超过10亿');
return false; return false;
} }
} }
$issue_record = CoinIssueCoin::find()->where(['platform_id' => $this->platform_id, 'symbol' => $this->symbol, 'status' => CoinIssueCoin::STATUS_SUCCESS])->sum('total'); $issue_record = CoinIssueCoin::find()->where(['platform_id' => $this->platform_id, 'symbol' => $this->symbol, 'status' => CoinIssueCoin::STATUS_SUCCESS])->sum('total');
$issue_record = empty($issue_record) ? 0 : $issue_record; $issue_record = empty($issue_record) ? 0 : $issue_record;
if ($issue_record + $this->$attribute > 900) { if ($issue_record + $this->$attribute > (900 * 1e4)) {
$this->addError($attribute, '最大发行量900亿,目前已发行' . $issue_record . '亿'); $this->addError($attribute, '最大发行量900亿,目前已发行' . $issue_record . '亿');
return false; return false;
} }
...@@ -163,18 +163,6 @@ class CoinIssueCoin extends CommonActiveRecord ...@@ -163,18 +163,6 @@ class CoinIssueCoin extends CommonActiveRecord
return array_merge(parent::attributes(), ['issue_charge', 'url', 'chain_name']); return array_merge(parent::attributes(), ['issue_charge', 'url', 'chain_name']);
} }
/**
* 获取状态数组
* @return array
*/
public static function getAgentStatus()
{
return [
self::STATUS_SUCCESS => '发行成功',
self::STATUS_FAIL => '发行失败',
];
}
public function getChain() public function getChain()
{ {
return $this->hasOne(CoinPlatformWithHold::className(), ['id' => 'chain_id']); return $this->hasOne(CoinPlatformWithHold::className(), ['id' => 'chain_id']);
......
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