Commit 5d40bd63 authored by shajiaiming's avatar shajiaiming

fix

parent 2a4156b6
......@@ -70,6 +70,7 @@ class CoinIssueCoin extends CommonActiveRecord
public function verfiyName($attribute, $params)
{
//增发
if (CoinIssueCoin::TYPE_YES == $this->type) {
$model = CoinIssueCoin::find()->where(['name' => $this->name, 'owner' => $this->owner, 'platform_id' => $this->platform_id, 'status' => CoinIssueCoin::STATUS_SUCCESS])->orderBy('id desc')->one();
if (false == $model) {
......@@ -81,8 +82,10 @@ class CoinIssueCoin extends CommonActiveRecord
return false;
}
}
//非增发
if (CoinIssueCoin::TYPE_NO == $this->type) {
$model = CoinIssueCoin::find()->where(['name' => $this->name, 'owner' => $this->owner, 'platform_id' => $this->platform_id, 'status' => CoinIssueCoin::STATUS_SUCCESS])->orderBy('id desc')->one();
$model = CoinIssueCoin::find()->where(['name' => $this->name, 'platform_id' => $this->platform_id, 'status' => CoinIssueCoin::STATUS_SUCCESS])->orderBy('id desc')->one();
if ($model) {
$this->addError($attribute, 'Token名称已存在');
return false;
......@@ -109,7 +112,7 @@ class CoinIssueCoin extends CommonActiveRecord
}
}
if (CoinIssueCoin::TYPE_NO == $this->type) {
$model = CoinIssueCoin::find()->where(['symbol' => $this->symbol, 'owner' => $this->owner, 'platform_id' => $this->platform_id, 'status' => CoinIssueCoin::STATUS_SUCCESS])->orderBy('id desc')->one();
$model = CoinIssueCoin::find()->where(['symbol' => $this->symbol, 'platform_id' => $this->platform_id, 'status' => CoinIssueCoin::STATUS_SUCCESS])->orderBy('id desc')->one();
if ($model) {
$this->addError($attribute, 'Token名称已存在');
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