|
|
@@ -0,0 +1,56 @@
|
|
|
+<?php
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+// | 商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+// | Copyright (c) 2017~2021 https://www.thinkphp.com All rights reserved.
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+// | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+// | Author: thinkphp <admin@yiovo.com>
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+declare (strict_types = 1);
|
|
|
+
|
|
|
+namespace app\store\validate\schools;
|
|
|
+
|
|
|
+use think\Validate;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 验证类:学校账号
|
|
|
+ * Class User
|
|
|
+ * @package app\store\validate\schools
|
|
|
+ */
|
|
|
+class User extends Validate
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * 验证规则
|
|
|
+ * @var array
|
|
|
+ */
|
|
|
+ protected $rule = [
|
|
|
+ 'user_name'=> ['require','max:20'],
|
|
|
+ 'password'=> ['require','max:50'],
|
|
|
+ 'real_name'=> ['require','max:20'],
|
|
|
+ 'school_id'=> ['require'],
|
|
|
+ 'user_type'=> ['require'],
|
|
|
+ ];
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 验证提示
|
|
|
+ * @var string[]
|
|
|
+ */
|
|
|
+ protected $message = [
|
|
|
+ 'qq.number' => 'QQ号格式不正确',
|
|
|
+ 'idcard.require' => '身份证号不为空',
|
|
|
+ 'idcard.idCard' => '身份证号格式不正确',
|
|
|
+ 'idcard.max' => '身份证号格式不正确',
|
|
|
+ 'mobile.require' => '手机号不为空',
|
|
|
+ 'user_type.require' => '账号类型不为空',
|
|
|
+ 'mobile.mobile' => '手机号格式不正确',
|
|
|
+ 'user_login.require' => '账号不为空',
|
|
|
+ 'user_login.max' => '账号格式不正确',
|
|
|
+ 'nick_name.require' => '昵称不为空',
|
|
|
+ 'nick_name.max' => '昵称格式不正确',
|
|
|
+ 'real_name.require' => '姓名不为空',
|
|
|
+ 'real_name.max' => '姓名格式不正确',
|
|
|
+ 'gender.require' => '性别不为空',
|
|
|
+ ];
|
|
|
+}
|