Browse Source

判断排序不得大于65535

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
dbb2d7bbf0
  1. 5
      vendor/antgoods/goods/src/models/ars/Attribute.php

5
vendor/antgoods/goods/src/models/ars/Attribute.php

@ -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");
}
} }
/** /**

Loading…
Cancel
Save