<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台（PHP版）
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码，建议反馈是我们前进的动力
// | 开源版本可自由商用，可去除界面版权logo
// | gitee下载：https://gitee.com/likeshop_gitee/likeadmin
// | github下载：https://github.com/likeshop-github/likeadmin
// | 访问官网：https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------

namespace app\adminapi\validate\master_worker;


use app\common\validate\BaseValidate;


/**
 * MasterWorker验证器
 * Class MasterWorkerValidate
 * @package app\adminapi\validate\master_worker
 */
class MasterWorkerValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'sn' => 'require',
        'avatar' => 'require',
        'real_avatar' => 'require',
        'real_name' => 'require',
        'nickname' => 'require',
        'account' => 'require',
        'password' => 'require',
        'mobile' => 'require',
        'sex' => 'require',
        'channel' => 'require',
        'is_disable' => 'require',
        'login_ip' => 'require',
        'login_time' => 'require',
        'is_new_user' => 'require',
        'exp' => 'require',

    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'sn' => '编号',
        'avatar' => '头像',
        'real_avatar' => '真实头像',
        'real_name' => '真实姓名',
        'nickname' => '用户昵称',
        'account' => '工程师账号',
        'password' => '工程师密码',
        'mobile' => '工程师电话',
        'sex' => '工程师性别',
        'channel' => '注册渠道',
        'is_disable' => '是否禁用',
        'login_ip' => '最后登录IP',
        'login_time' => '最后登录时间',
        'is_new_user' => '是否是新注册用户: [1-是, 0-否]',
        'exp' => '经验值',

    ];


    /**
     * @notes 添加场景
     * @return MasterWorkerValidate
     * @author likeadmin
     * @date 2024/07/10 18:17
     */
    public function sceneAdd()
    {
        return $this->only(['sn','real_name','nickname','account','password','mobile','sex','channel','is_disable','login_ip','login_time','is_new_user','exp','lon','lat','distance']);
    }


    /**
     * @notes 编辑场景
     * @return MasterWorkerValidate
     * @author likeadmin
     * @date 2024/07/10 18:17
     */
    public function sceneEdit()
    {
        return $this->only(['id','sn','nickname','account','password','mobile','sex','channel','is_disable']);
    }


    /**
     * @notes 删除场景
     * @return MasterWorkerValidate
     * @author likeadmin
     * @date 2024/07/10 18:17
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 详情场景
     * @return MasterWorkerValidate
     * @author likeadmin
     * @date 2024/07/10 18:17
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }

    public function sceneSaltToPassword()
    {
        return $this->only(['password']);
    }
}