diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index cf6b2621..5703f782 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -735,16 +735,16 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess } if (str_starts_with($table, $tablePrefix)) { - return '`' . static::getDbName() . '`' . $table; + return '`' . static::getDbName() . '`.' . $table; } else if (!str_starts_with($table, '{{%')) { - return '`' . static::getDbName() . '`' . $table; + return '`' . static::getDbName() . '`.' . $table; } $table = trim($table, '{{%}}'); if ($tablePrefix) { - $table = '`' . static::getDbName() . '`' . $tablePrefix . $table; + $table = '`' . static::getDbName() . '`.' . $tablePrefix . $table; } - return '`' . static::getDbName() . '`' . $table; + return '`' . static::getDbName() . '`.' . $table; }