top-think / top-think/think-orm

模型视图_数据验证问题

Open
#845 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
437
Forks
188
PR merge metrics
No merged PRs in 30d

Description

1、文档中 $this->data($data)=->save();data 方法只传递了一个参数 、此时他并不会走验证 因为 第二个参数 $validate 默认是 false 需要手动传递true 才行

Image Image 2、这个 validate 方法中->check($data)现在默认传递了 data 是否可以考虑增加第二个 参数 ‘array | string $rules = []’ 来兼容一下自定义验证组 Image Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by checking the documented Model data/save usage and the validate()->check($data) entry point described in the issue. Confirm the current validation behavior and custom validation-group requirements; done means the documentation and API behavior consistently support the requested validation options, with corresponding coverage where the project’s existing tests apply.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.