升级到31版本、修改学生成绩筛选
This commit is contained in:
1 parent
a79e7bf237
commit
d8ec4fad39
34 files changed
+447
-114
No files matched your search
@@ -326,7 +326,7 @@ class Query
|
||||
*/
|
||||
public function execute($sql, $bind = [])
|
||||
{
|
||||
return $this->connection->execute($sql, $bind);
|
||||
return $this->connection->execute($sql, $bind, $this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -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) {
|
||||
@@ -3567,7 +3573,7 @@ class Query
|
||||
$options['order'] = explode(',', $options['order']);
|
||||
}
|
||||
foreach ($options['order'] as $key => $val) {
|
||||
if (is_numeric($key)) {
|
||||
if (is_numeric($key) && is_string($val)) {
|
||||
if (strpos($val, ' ')) {
|
||||
list($field, $sort) = explode(' ', $val);
|
||||
if (array_key_exists($field, $options['map'])) {
|
||||
|
||||
Reference in new issue
Block a user