<?php /** * Author: xiaojie * DateTime: 2018/12/03 17:15 */ namespace app\portal\validate; use think\Validate; class UsersValidate extends Validate { protected $rule = [ 'mobile' => 'require', 'password' => 'require', 'create_time' => 'require', 'last_login_time' => 'require', 'last_login_ip' => 'require', 'last_login_address' => 'require', 'login_num' => 'require', ]; protected $message = [ 'mobile.require' => '手机号不能为空!', 'password.require' => '密码不能为空!', 'create_time.require' => '注册时间不能为空!', 'last_login_time.require' => '上次登陆时间不能为空!', 'last_login_ip.require' => '上次登录ip不能为空!', 'last_login_address.require' => '上次登录地址不能为空!', 'login_num.require' => '登录次数不能为空!', ]; protected $scene = [ 'add' => ['mobile,password,create_time'], 'edit' => ['last_login_time,last_login_ip,last_login_address,login_num'], ]; }