This commit is contained in:
as2252258@163.com
2021-07-03 16:14:57 +08:00
parent 1fad90e1e7
commit d0f3469997
+3 -3
View File
@@ -734,16 +734,16 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
} }
if (str_starts_with($table, $tablePrefix)) { if (str_starts_with($table, $tablePrefix)) {
return $table; return '`' . static::getDbName() . '`' . $table;
} else if (!str_starts_with($table, '{{%')) { } else if (!str_starts_with($table, '{{%')) {
return $table; return '`' . static::getDbName() . '`' . $table;
} }
$table = trim($table, '{{%}}'); $table = trim($table, '{{%}}');
if ($tablePrefix) { if ($tablePrefix) {
$table = $tablePrefix . $table; $table = $tablePrefix . $table;
} }
return $table; return '`' . static::getDbName() . '`' . $table;
} }