mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
jion方法的条件支持传入Expression对象
This commit is contained in:
@@ -545,7 +545,9 @@ abstract class Builder
|
|||||||
list($table, $type, $on) = $item;
|
list($table, $type, $on) = $item;
|
||||||
$condition = [];
|
$condition = [];
|
||||||
foreach ((array) $on as $val) {
|
foreach ((array) $on as $val) {
|
||||||
if (strpos($val, '=')) {
|
if ($val instanceof Expression) {
|
||||||
|
$condition[] = $val->getValue();
|
||||||
|
} elseif (strpos($val, '=')) {
|
||||||
list($val1, $val2) = explode('=', $val, 2);
|
list($val1, $val2) = explode('=', $val, 2);
|
||||||
$condition[] = $this->parseKey($val1, $options) . '=' . $this->parseKey($val2, $options);
|
$condition[] = $this->parseKey($val1, $options) . '=' . $this->parseKey($val2, $options);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -924,7 +924,7 @@ class Query
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string|array $table 数据表
|
* @param string|array $table 数据表
|
||||||
* @param string|array $field 查询字段
|
* @param string|array $field 查询字段
|
||||||
* @param string|array $on JOIN条件
|
* @param mixed $on JOIN条件
|
||||||
* @param string $type JOIN类型
|
* @param string $type JOIN类型
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user