top-think / top-think/think-orm

withJoin关联查询,使用软删除,仍然能把外联的数据查出来。

Open
#397 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

比如这句sql:

SELECT * 
FROM `yj_system_admin` `system_admin` 
LEFT JOIN `yj_app_unit` `appUnit` ON `system_admin`.`unit_id`=`appUnit`.`id` 
WHERE `system_admin`.`delete_time` = '0' 
ORDER BY `sort` DESC,`system_admin`.`id` DESC 
LIMIT 0,15

这里的app_unit也是软删除,是不是也应该加上appUnit.delete_time = 0

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 reproducing the reported withJoin query against yj_system_admin and yj_app_unit, then trace the ORM's join handling for soft-deleted models. Done means confirming whether the joined appUnit rows should be filtered by appUnit.delete_time = 0 and adding or updating coverage for that behavior.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.