升级thinkphp到5.1.39

This commit is contained in:
cxdbz committed 2019-11-28 19:33:13 +08:00
1 parent c8839fa4f8
commit a58d04e7e2
37 files changed
+546 -192

No files matched your search

+14 -7
View File
@@ -313,9 +313,10 @@ abstract class Builder
// 使用闭包查询
$newQuery = $query->newQuery()->setConnection($this->connection);
$value($newQuery);
$whereClause = $this->buildWhere($query, $newQuery->getOptions('where'));
$whereClause = $this->buildWhere($newQuery, $newQuery->getOptions('where'));
if (!empty($whereClause)) {
$query->bind($newQuery->getBind(false));
$str[] = ' ' . $logic . ' ( ' . $whereClause . ' )';
}
} elseif (is_array($field)) {
@@ -407,7 +408,7 @@ abstract class Builder
$jsonType = $query->getJsonFieldType($field);
$bindType = $this->connection->getFieldBindType($jsonType);
} else {
$bindType = isset($binds[$field]) ? $binds[$field] : PDO::PARAM_STR;
$bindType = isset($binds[$field]) && 'LIKE' != $exp ? $binds[$field] : PDO::PARAM_STR;
}
if (is_scalar($value) && !in_array($exp, ['EXP', 'NOT NULL', 'NULL', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN']) && strpos($exp, 'TIME') === false) {
@@ -450,7 +451,7 @@ abstract class Builder
// 模糊匹配
if (is_array($value)) {
foreach ($value as $item) {
$name = $query->bind($item, $bindType);
$name = $query->bind($item, PDO::PARAM_STR);
$array[] = $key . ' ' . $exp . ' :' . $name;
}
@@ -604,6 +605,10 @@ abstract class Builder
$value = $this->parseClosure($query, $value);
}
if ('=' == $exp && is_null($value)) {
return $key . ' IS NULL';
}
return $key . ' ' . $exp . ' ' . $value;
}
@@ -651,7 +656,6 @@ abstract class Builder
$value = $value->getValue();
} else {
$value = array_unique(is_array($value) ? $value : explode(',', $value));
$array = [];
foreach ($value as $k => $v) {
@@ -659,9 +663,12 @@ abstract class Builder
$array[] = ':' . $name;
}
$zone = implode(',', $array);
$value = empty($zone) ? "''" : $zone;
if (count($array) == 1) {
return $key . ('IN' == $exp ? ' = ' : ' <> ') . $array[0];
} else {
$zone = implode(',', $array);
$value = empty($zone) ? "''" : $zone;
}
}
return $key . ' ' . $exp . ' (' . $value . ')';