mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 15:02:47 +08:00
改进软删除
This commit is contained in:
@@ -36,10 +36,11 @@ class Mysql extends Builder
|
|||||||
$key = 'json_extract(' . $field . ', \'$.' . $name . '\')';
|
$key = 'json_extract(' . $field . ', \'$.' . $name . '\')';
|
||||||
} elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) {
|
} elseif (strpos($key, '.') && !preg_match('/[,\'\"\(\)`\s]/', $key)) {
|
||||||
list($table, $key) = explode('.', $key, 2);
|
list($table, $key) = explode('.', $key, 2);
|
||||||
|
if ('__TABLE__' == $table) {
|
||||||
|
$table = $this->query->getTable();
|
||||||
|
}
|
||||||
if (isset($options['alias'][$table])) {
|
if (isset($options['alias'][$table])) {
|
||||||
$table = $options['alias'][$table];
|
$table = $options['alias'][$table];
|
||||||
} elseif ('__TABLE__' == $table) {
|
|
||||||
$table = $this->query->getTable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!preg_match('/[,\'\"\*\(\)`.\s]/', $key)) {
|
if (!preg_match('/[,\'\"\*\(\)`.\s]/', $key)) {
|
||||||
|
|||||||
@@ -55,10 +55,11 @@ class Pgsql extends Builder
|
|||||||
$key = $field . '->>\'' . $name . '\'';
|
$key = $field . '->>\'' . $name . '\'';
|
||||||
} elseif (strpos($key, '.')) {
|
} elseif (strpos($key, '.')) {
|
||||||
list($table, $key) = explode('.', $key, 2);
|
list($table, $key) = explode('.', $key, 2);
|
||||||
|
if ('__TABLE__' == $table) {
|
||||||
|
$table = $this->query->getTable();
|
||||||
|
}
|
||||||
if (isset($options['alias'][$table])) {
|
if (isset($options['alias'][$table])) {
|
||||||
$table = $options['alias'][$table];
|
$table = $options['alias'][$table];
|
||||||
} elseif ('__TABLE__' == $table) {
|
|
||||||
$table = $this->query->getTable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($table)) {
|
if (isset($table)) {
|
||||||
|
|||||||
@@ -60,10 +60,11 @@ class Sqlite extends Builder
|
|||||||
$key = trim($key);
|
$key = trim($key);
|
||||||
if (strpos($key, '.')) {
|
if (strpos($key, '.')) {
|
||||||
list($table, $key) = explode('.', $key, 2);
|
list($table, $key) = explode('.', $key, 2);
|
||||||
|
if ('__TABLE__' == $table) {
|
||||||
|
$table = $this->query->getTable();
|
||||||
|
}
|
||||||
if (isset($options['alias'][$table])) {
|
if (isset($options['alias'][$table])) {
|
||||||
$table = $options['alias'][$table];
|
$table = $options['alias'][$table];
|
||||||
} elseif ('__TABLE__' == $table) {
|
|
||||||
$table = $this->query->getTable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($table)) {
|
if (isset($table)) {
|
||||||
|
|||||||
@@ -73,10 +73,11 @@ class Sqlsrv extends Builder
|
|||||||
$key = trim($key);
|
$key = trim($key);
|
||||||
if (strpos($key, '.') && !preg_match('/[,\'\"\(\)\[\s]/', $key)) {
|
if (strpos($key, '.') && !preg_match('/[,\'\"\(\)\[\s]/', $key)) {
|
||||||
list($table, $key) = explode('.', $key, 2);
|
list($table, $key) = explode('.', $key, 2);
|
||||||
|
if ('__TABLE__' == $table) {
|
||||||
|
$table = $this->query->getTable();
|
||||||
|
}
|
||||||
if (isset($options['alias'][$table])) {
|
if (isset($options['alias'][$table])) {
|
||||||
$table = $options['alias'][$table];
|
$table = $options['alias'][$table];
|
||||||
} elseif ('__TABLE__' == $table) {
|
|
||||||
$table = $this->query->getTable();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!is_numeric($key) && !preg_match('/[,\'\"\*\(\)\[.\s]/', $key)) {
|
if (!is_numeric($key) && !preg_match('/[,\'\"\*\(\)\[.\s]/', $key)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user