Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql decimal field should be marked as string instead of float #549

Open
taobig opened this issue Aug 11, 2024 · 0 comments
Open

Mysql decimal field should be marked as string instead of float #549

taobig opened this issue Aug 11, 2024 · 0 comments

Comments

@taobig
Copy link
Contributor

taobig commented Aug 11, 2024

There is a decimal field in mysql table.

...
`amount`    decimal(20, 2) NOT NULL 
...

generate model by gii

...
* @property float $amount
...

By var_dump($model->attributes); you know that $model->amount is a value of type string.

What's expected?

...
* @property string $amount
...

Additional info

Q A
Yii version 2.0.49
gii version 2.2.6
PHP version 8.1
Database version MySQL 8.0

I think the key is here:

protected function generateProperties($table)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant