top-think / top-think/think-orm
一对多关联删除的问题?
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 437
- Forks
- 188
- PR merge metrics
- No merged PRs in 30d
Description
一对多关联,Order -> Goods
在调用$order->goods()->delete();时会提示delete without condition。
我想了解一下这个地方不“执行基础查询”,带入关联条件,是基于什么考虑呢?
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 with src/model/Relation.php around line 210 and reproduce the one-to-many call $order->goods()->delete() described in the issue. Trace how the relation condition and base query are handled, then determine why the delete triggers the “delete without condition” warning. Done means the behavior and its intended handling are documented or corrected with a verified reproduction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100