Fix methods Hyperf\Database\Query\Builder::eachById bug and optimize code.#7671
Closed
gokure wants to merge 3 commits intohyperf:masterfrom
Closed
Fix methods Hyperf\Database\Query\Builder::eachById bug and optimize code.#7671gokure wants to merge 3 commits intohyperf:masterfrom
Hyperf\Database\Query\Builder::eachById bug and optimize code.#7671gokure wants to merge 3 commits intohyperf:masterfrom
Conversation
| use Hyperf\Database\Exception\MultipleRecordsFoundException; | ||
| use Hyperf\Database\Exception\RecordsNotFoundException; | ||
| use Hyperf\Database\Model\Builder; | ||
| use Hyperf\Database\Model\Collection; |
Contributor
Author
There was a problem hiding this comment.
使用 Collection\Collection 代替 Model\Collection,使得 BuildsQueries Trait 更抽象了,其中的方法可以被 Query\Builder 和 Model\Builder 同时使用
Contributor
Author
There was a problem hiding this comment.
原来的 BuildsQueries 中混合使用了 Collection\Colleciton 和 Model\Collection,混乱易出错
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue with the method
Query\Builder::eachByIdcalled byDb::table('artiles')->eachById(...).TypeErroroccurred when the third ($column) argument was not provided.TypeErrorbecause aHyperf\Collection\Collectioninstance was passed.Further changes:
chunkByIdtoorderedChunkById(to streamline functionality).Query\Builder\paginatorandQuery\Builder\simplePaginatorwhich are identical to those in theBuildsQueirstrait.