Browse Source

增加手机号码验证规则

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
b2d50d654d
  1. 3
      vendor/antgoods/goods/src/models/ars/Supplier.php

3
vendor/antgoods/goods/src/models/ars/Supplier.php

@ -40,6 +40,9 @@ class Supplier extends \yii\db\ActiveRecord
[['is_delete'], 'integer'], [['is_delete'], 'integer'],
[['name', 'full_name', 'address'], 'string', 'max' => 50], [['name', 'full_name', 'address'], 'string', 'max' => 50],
[['phone'], 'string', 'max' => 20], [['phone'], 'string', 'max' => 20],
['phone', 'filter', 'filter' => 'trim'],
['phone','match','pattern'=>'/^[1][34578][0-9]{9}$/'],
['phone', 'unique', 'targetClass' => '\antgoods\goods\models\ars\Supplier', 'message' => '手机号已被使用'],
]; ];
} }

Loading…
Cancel
Save