|
@ -55,9 +55,12 @@ class Attribute extends \yii\db\ActiveRecord |
|
|
*/ |
|
|
*/ |
|
|
public function checkNegative($attribute, $params) |
|
|
public function checkNegative($attribute, $params) |
|
|
{ |
|
|
{ |
|
|
if ((integer)$this->$attribute < 0) { |
|
|
|
|
|
|
|
|
if ($this->$attribute < 0) { |
|
|
$this->addError($attribute, "不得为负数"); |
|
|
$this->addError($attribute, "不得为负数"); |
|
|
} |
|
|
} |
|
|
|
|
|
if ($this->$attribute > 65535) { |
|
|
|
|
|
$this->addError($attribute, "不得大于65535"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|