multi-store/app/api/validate/UserValidate.php

113 lines
2.3 KiB
PHP

<?php
namespace app\api\validate;
use app\common\model\auth\Admin;
use app\common\validate\BaseValidate;
/**
* 用户验证器
* Class UserValidate
* @package app\shopapi\validate
*/
class UserValidate extends BaseValidate
{
protected $rule = [
'code' => 'require',
'store_id' => 'require',
'mobile' => 'require',
'phone' => 'require|number',
'password' => 'require|length:6',
'rePassword' => 'require|requireWith:password|confirm:password',
'type' => 'require',
'account' => 'require',
'real_name' => 'require',
'id_card' => 'require|idCard',
];
protected $message = [
'code.require' => '参数缺失',
'store_id.require' => '门店id',
'mobile.require' => '手机',
'phone.require' => '手机',
'account.require' => '手机',
'password.require' => '密码缺失',
'rePassword.require' => '确认密码缺失',
'type' => '查询类型',
'id_card' => '身份证格式错误',
'real_name' => '姓名不能为空',
];
public function sceneLogin()
{
return $this->only(['account']);
}
public function sceneFund()
{
return $this->only(['type']);
}
public function sceneCard()
{
return $this->only(['id_card','real_name']);
}
//设置/更新密码
public function sceneSetPayPassword()
{
return $this->only(['code','password','rePassword']);
}
/**
* @notes 获取小程序手机号场景
* @return UserValidate
* @author 段誉
* @date 2022/9/21 16:44
*/
public function sceneGetMobileByMnp()
{
return $this->only(['code']);
}
/**
* @notes 绑定/变更 手机号
* @return UserValidate
* @author 段誉
* @date 2022/9/21 17:37
*/
public function sceneBindMobile()
{
return $this->only(['mobile', 'code']);
}
/**
* @notes 充值
* @return UserValidate
* @author: codeliu
* @Time: 2024/6/4 22:50
*/
public function sceneRechargeMoney()
{
return $this->only(['price']);
}
/**
* @notes 充值
* @return UserValidate
* @Time: 2024/6/4 22:50
*/
public function sceneRechargeStoreMoney()
{
return $this->only(['price']);
}
}