Commit d01e3e1e authored by shajiaiming's avatar shajiaiming

fix

parent bb6fb419
...@@ -107,10 +107,16 @@ class CoinIssueCoin extends CommonActiveRecord ...@@ -107,10 +107,16 @@ class CoinIssueCoin extends CommonActiveRecord
public function verfiyAmount($attribute, $params) public function verfiyAmount($attribute, $params)
{ {
if (CoinIssueCoin::TYPE_YES == $this->type) {
if ($this->$attribute > 10) {
$this->addError($attribute, '增发发行量不能超过10亿');
return false;
}
}
$issue_record = CoinIssueCoin::find()->where(['platform_id' => $this->platform_id, 'status' => CoinIssueCoin::STATUS_SUCCESS])->sum('total'); $issue_record = CoinIssueCoin::find()->where(['platform_id' => $this->platform_id, '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 >= 22) {
$this->addError($attribute, '最大发行量900亿,目前已发行' . $issue_record . '亿'); $this->addError($attribute, '最大发行量22亿,目前已发行' . $issue_record . '亿');
return false; return false;
} }
} }
......
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