Commit 9cb94326 authored by shajiaiming's avatar shajiaiming

修复已知问题

parent f10f61ed
...@@ -42,11 +42,24 @@ class CoinIssueCoin extends CommonActiveRecord ...@@ -42,11 +42,24 @@ class CoinIssueCoin extends CommonActiveRecord
['msg', 'string', 'length' => [1, 10]], ['msg', 'string', 'length' => [1, 10]],
['name', 'string', 'length' => [1, 6]], ['name', 'string', 'length' => [1, 6]],
#['status', 'in', 'range' => [1, 2, 0]], #['status', 'in', 'range' => [1, 2, 0]],
['name', 'verfiyName'],
['symbol', 'verfiySymbol'], ['symbol', 'verfiySymbol'],
['total', 'verfiyAmount'] ['total', 'verfiyAmount']
]; ];
} }
public function verfiyName($attribute, $params)
{
$model = CoinIssueCoin::find()->where(['name' => $this->name, 'platform_id' => $this->platform_id])->orderBy('id desc')->one();
if (false == $model) {
return true;
}
if (0 == $model->category) {
$this->addError($attribute, '名称已存在');
return false;
}
}
public function verfiySymbol($attribute, $params) public function verfiySymbol($attribute, $params)
{ {
$model = CoinIssueCoin::find()->where(['symbol' => $this->symbol, 'platform_id' => $this->platform_id])->orderBy('id desc')->one(); $model = CoinIssueCoin::find()->where(['symbol' => $this->symbol, 'platform_id' => $this->platform_id])->orderBy('id desc')->one();
......
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