top-think / think-orm

Think ORM——the PHP Database&ORM Framework
Apache License 2.0
413 stars 171 forks source link

模型的类型转换声明添加字符串支持 #610

Closed NHZEX closed 3 weeks ago

NHZEX commented 3 weeks ago

某些情况下需要字符串类型转换支持。

比如bigint在不同精度下会在字符串或整数间自动切换,提供字符串类型转换后能确保模型取值类型的一致性。

codecov-commenter commented 3 weeks ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 85.71429% with 4 lines in your changes missing coverage. Please review.

Project coverage is 17.40%. Comparing base (e35f497) to head (f02da54). Report is 71 commits behind head on 3.0.

Files Patch % Lines
src/model/concern/Attribute.php 85.71% 4 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 3.0 #610 +/- ## ============================================ + Coverage 12.24% 17.40% +5.15% - Complexity 2965 3004 +39 ============================================ Files 64 64 Lines 7129 7201 +72 ============================================ + Hits 873 1253 +380 + Misses 6256 5948 -308 ``` | [Flag](https://app.codecov.io/gh/top-think/think-orm/pull/610/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=top-think) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/top-think/think-orm/pull/610/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=top-think) | `17.40% <85.71%> (+5.15%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=top-think#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.