coupon-admin/app/validate/User.php

27 lines
663 B
PHP
Raw Normal View History

2021-11-18 09:57:04 +00:00
<?php
namespace app\validate;
use think\Validate;
class User extends Validate
{
protected $rule = [
'code|小程序code' => 'require',
2021-11-24 08:19:54 +00:00
'nick_name|昵称' => 'max:100',
'avatar_url|头像' => 'max:250',
'gender|性别' => 'number',
2021-12-15 07:04:20 +00:00
'lat|位置' => 'require|>:0',
'lng|位置' => 'require|>:0',
2021-11-18 09:57:04 +00:00
];
2021-12-16 02:34:06 +00:00
protected $message = [
'lat.require' => '请授权位置信息',
'lng.require' => '请授权位置信息',
];
2021-11-18 09:57:04 +00:00
protected $scene = [
// 微信小程序登录
2021-12-15 07:04:20 +00:00
'wx_applets' => ['code', 'nick_name', 'gender',"lat","lng"],
2021-11-18 09:57:04 +00:00
];
}