-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
优化hasWhere方法 #596
优化hasWhere方法 #596
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## 3.0 #596 +/- ##
============================================
+ Coverage 12.24% 12.26% +0.01%
- Complexity 2965 2980 +15
============================================
Files 64 64
Lines 7129 7150 +21
============================================
+ Hits 873 877 +4
- Misses 6256 6273 +17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
其它的能理解 但不需要软删除这个还需要讨论下 |
看下第二条的代码和打印的sql,现在无法对关联模型的软删除支持(像withjoin也是不行的) |
我的理解是不是软删除目前支持有点问题 但不代表不能支持 而且从需求来说 软删除也是有需求的 |
是的,现在不行,如果想支持关联模型的软删除,改动比较大,建议把用到join的地方都改一下 |
我目前测试下来 在进行了你提交的相关修正后 软删除看起来是没问题的 |
现在如果只是单用hasWhere是没问题的,如果和其他where同时用,就不行了。 所以我建议先去掉,后面底层优化支持一下 |
我测试的就是haswhere和where一起使用的情况 |
1.hasWhere和where方法同时使用,没有自动加别名
2.对关联模型的软删除查询有问题,如果hasWhere闭包里写的有or查询会导致软删除查询限制无效
3.where方法传入query类的时候,会清空替换掉前面的查询条件
优化如下:增加默认查询条件下的字段别名,去除关联模型的软删除查询(像withjoin和join都不支持都对关联模型的软删除查询),hasWhere函数内where增加闭包(支持和where方法同时使用)