thinkphp安全更新
This commit is contained in:
@@ -656,9 +656,9 @@ class Query
|
||||
$query->fetchSql(true);
|
||||
}
|
||||
|
||||
$count = $query->aggregate('COUNT', '*');
|
||||
$count = $query->aggregate('COUNT', '*', true);
|
||||
} else {
|
||||
$count = $this->aggregate('COUNT', $field);
|
||||
$count = $this->aggregate('COUNT', $field, true);
|
||||
}
|
||||
|
||||
return is_string($count) ? $count : (int) $count;
|
||||
@@ -1008,11 +1008,13 @@ class Query
|
||||
if ($tableName) {
|
||||
// 添加统一的前缀
|
||||
$prefix = $prefix ?: $tableName;
|
||||
foreach ($field as $key => $val) {
|
||||
if (is_numeric($key)) {
|
||||
$val = $prefix . '.' . $val . ($alias ? ' AS ' . $alias . $val : '');
|
||||
foreach ($field as $key => &$val) {
|
||||
if (is_numeric($key) && $alias) {
|
||||
$field[$prefix . '.' . $val] = $alias . $val;
|
||||
unset($field[$key]);
|
||||
} elseif (is_numeric($key)) {
|
||||
$val = $prefix . '.' . $val;
|
||||
}
|
||||
$field[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3548,6 +3550,10 @@ class Query
|
||||
*/
|
||||
protected function parseView(&$options)
|
||||
{
|
||||
if (!isset($options['map'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (['AND', 'OR'] as $logic) {
|
||||
if (isset($options['where'][$logic])) {
|
||||
foreach ($options['where'][$logic] as $key => $val) {
|
||||
|
||||
Reference in New Issue
Block a user