top-think / top-think/think-orm
一对多关联字段查询BUG
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 437
- Forks
- 188
- PR merge metrics
- No merged PRs in 30d
Description
如果表有前缀就会报错,直接获取表明也不是个问题啊;再或者表明和模型名不一样也是有问题
if ($this->baseQuery) {
$throughKey = $this->query->getTable() . '.' . $this->throughKey;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/model/relation/HasManyThrough.php around line 270 and inspect how the through table is obtained when baseQuery is present. Reproduce the relation query with a table prefix and with a table name that differs from the model name; done means both cases resolve the correct table and no longer raise an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100