Commit 0a63c10e authored by shajiaiming's avatar shajiaiming

fix

parent bce7b5f9
...@@ -52,7 +52,7 @@ class CoinIssueCoin extends CommonActiveRecord ...@@ -52,7 +52,7 @@ class CoinIssueCoin extends CommonActiveRecord
[['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit', 'charge', 'template'], 'required'], [['name', 'symbol', 'total', 'owner', 'introduction', 'category', 'type', 'platform_id', 'chain_id', 'charge_unit', 'charge', 'template'], 'required'],
[['total', 'category', 'type', 'platform_id', 'chain_id'], 'integer'], [['total', 'category', 'type', 'platform_id', 'chain_id'], 'integer'],
[['introduction', 'charge_unit'], 'string', 'length' => [1, 100]], [['introduction', 'charge_unit'], 'string', 'length' => [1, 100]],
['symbol', 'string', 'length' => [6, 128]], //['symbol', 'string', 'length' => [6, 128]],
['name', 'string', 'length' => [3, 50]], ['name', 'string', 'length' => [3, 50]],
['nickname', 'string', 'length' => [0, 10]], ['nickname', 'string', 'length' => [0, 10]],
[['token_type', 'nickname'], 'safe'], [['token_type', 'nickname'], 'safe'],
...@@ -123,6 +123,18 @@ class CoinIssueCoin extends CommonActiveRecord ...@@ -123,6 +123,18 @@ class CoinIssueCoin extends CommonActiveRecord
public function verfiySymbol($attribute, $params) public function verfiySymbol($attribute, $params)
{ {
if (35 == $this->platform_id) {
if (6 < strlen($this->symbol) && 16 < strlen($this->symbol)) {
$this->addError($attribute, 'Token简称需在6~16个字符');
return false;
}
} else {
if (1 < strlen($this->symbol) && 6 < strlen($this->symbol)) {
$this->addError($attribute, 'Token简称需在1~6个字符');
return false;
}
}
if (!preg_match('/^[a-zA-Z0-9]+$/u', $this->symbol)) { if (!preg_match('/^[a-zA-Z0-9]+$/u', $this->symbol)) {
$this->addError($attribute, 'Token简称必须包含字母和数字'); $this->addError($attribute, 'Token简称必须包含字母和数字');
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