top-think / top-think/think-orm

当chunk查询数量小于$count时,还会继续查询一次

Open
#337 0 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

是不是应该加一次$count判断

$total = count($resultSet);
while ($total > 0) {
    if (false === call_user_func($callback, $resultSet)) {
        return false;
    }
   
    if ($total < $count) {
        return true;
    }
}

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 locating the chunk-query implementation in the ORM and inspect the loop shown in the issue. Reproduce a query whose result count is less than $count, then verify that the callback runs once and no extra query is made before the operation returns.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.