'min:0.01', // 提现金额 'account_type' => "checkAccountType", 'transfer_type' => 'checkTransferType', 'account_id' => 'checkAccountId' ]; protected $message = [ 'apply_money.min' => 'validate_member_cash_out.apply_money_min', ]; protected $scene = [ 'apply' => ['apply_money', 'account_type', 'transfer_type', 'account_id'], ]; protected function checkAccountId($value, $rule, $data = []) { if ($data['transfer_type'] == TransferDict::WECHAT) { return true; } else { return !empty($value) ? true : 'validate_member_cash_out.account_id_require'; } } protected function checkTransferType($value) { return array_key_exists($value, TransferDict::getTransferType()) ? true : 'validate_member_cash_out.not_support_transfer_type'; } protected function checkAccountType($value) { $account_type = [MemberAccountTypeDict::MONEY, MemberAccountTypeDict::COMMISSION]; return in_array($value, $account_type) ? true : 'validate_member_cash_out.not_support_account_type'; } }