coupon-admin/app/validate/User.php

27 lines
663 B
PHP

<?php
namespace app\validate;
use think\Validate;
class User extends Validate
{
protected $rule = [
'code|小程序code' => 'require',
'nick_name|昵称' => 'max:100',
'avatar_url|头像' => 'max:250',
'gender|性别' => 'number',
'lat|位置' => 'require|>:0',
'lng|位置' => 'require|>:0',
];
protected $message = [
'lat.require' => '请授权位置信息',
'lng.require' => '请授权位置信息',
];
protected $scene = [
// 微信小程序登录
'wx_applets' => ['code', 'nick_name', 'gender',"lat","lng"],
];
}