<?php


namespace app\admin\validate;


class WalletValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'safe_word' => 'require',
        'operation_remark' => 'require|length:0,200',
        'address' => 'require|length:0,128',
        'user_id' => 'require',
        'amount' => 'require|float|min:0.01',
        'type' => 'require|in:recharge,withdraw',
        'payment_password' => 'require',
    ];

    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'safe_word' => '资金密码',
        'operation_remark' => '驳回原因',
        'address' => '提现地址',
        'user_id' => '用户ID',
        'amount' => '金额',
        'type' => '操作类型',
        'payment_password' => '资金密码',
    ];

    /**
     * @notes 充值审核通过
     */
    public function sceneRechargePass()
    {
        return $this->only(['safe_word', 'id']);
    }

    public function sceneRechargeRefuse()
    {
        return $this->only(['id', 'operation_remark']);
    }

    /**
     * @notes 提现审核通过
     */
    public function sceneWithdrawPass()
    {
        return $this->only(['safe_word', 'id']);
    } 

    public function sceneWithdrawRefuse()
    {
        return $this->only(['id', 'operation_remark']);
    }
    
    public function sceneUpdateAddress()
    {
        return $this->only(['id', 'safe_word', 'address']);
    }
    public function sceneChangeMoney()
    {
        return $this->only(['user_id', 'amount', 'type','payment_password']);
    }

}