Skip to content

Commit c1c16a9

Browse files
committed
[FIX] TV numeric cast expression.
1 parent f5a10f7 commit c1c16a9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Models/sLangContent.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,13 @@ protected static function resolveLocale(?string $locale): string
380380
protected function tvNumericCastExpression(string $column): string
381381
{
382382
$driver = DB::connection()->getDriverName();
383+
$prefix = DB::getTablePrefix();
383384

384385
return match ($driver) {
385-
'pgsql' => "CAST($column AS NUMERIC(10,2))",
386-
'sqlite' => "CAST($column AS REAL)",
387-
'mysql', 'mariadb' => "CAST($column AS DECIMAL(10,2))",
388-
default => "CAST($column AS DECIMAL(10,2))",
386+
'pgsql' => "CAST($prefix$column AS NUMERIC(10,2))",
387+
'sqlite' => "CAST($prefix$column AS REAL)",
388+
'mysql', 'mariadb' => "CAST($prefix$column AS DECIMAL(10,2))",
389+
default => "CAST($prefix$column AS DECIMAL(10,2))",
389390
};
390391
}
391392

0 commit comments

Comments
 (0)