top-think / top-think/think-orm

->find()时hidden/appen/visible 逻辑问题

Open
#508 8 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

当find为空时会输出null,这时我在->find()->hidden()是会报错的;
但是在->select()->hidden()没有问题
所以,为何不能在find为空时,如果使用hidden可以自动返回null, 而不是Call to a member function hidden() on null
输出统一比较好,我们去自己判断是多余的操作

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 tracing the ORM paths for find(), hidden(), and select()->hidden(), comparing how an empty find result differs from an empty select result. Check the existing ORM tests for these methods and define done as consistent null handling without the “Call to a member function hidden() on null” error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.