-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
修复查询构建器 join
方法传入 $where
参数的报错
#529
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要在 tests/unit/Component/Tests/Db/QueryCurdBaseTest.php
增加一个针对 join
的测试用例
src/Db/Query/Join.php
Outdated
@@ -186,7 +186,7 @@ public function toString(IQuery $query): string | |||
$result = $this->type . ' join ' . $this->table->toString($query) . ' on ' . $query->fieldQuote($this->left ?? '') . $this->operation . $query->fieldQuote($this->right ?? ''); | |||
if ($this->where instanceof IBaseWhere) | |||
{ | |||
$result .= ' ' . $this->where->toString($query); | |||
$result .= ' and ' . $this->where->toStringWithoutLogic($query); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and
可以用 $this->where->getLogicalOperator()
代替
join
方法传入 $where
参数的报错
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## 2.1 #529 +/- ##
============================================
- Coverage 64.33% 63.90% -0.43%
- Complexity 10986 10987 +1
============================================
Files 881 881
Lines 30048 30044 -4
============================================
- Hits 19332 19201 -131
- Misses 10716 10843 +127
☔ View full report in Codecov by Sentry. |
--------- Co-authored-by: 落幕 <[email protected]>
join操作时,如果有where对象,原本使用toString获取拼接语句是错的,因修改为toStringWithoutLogic,同时与sql语句拼接时,缺少and