top-think / think-orm

Think ORM——the PHP Database&ORM Framework
Apache License 2.0
416 stars 173 forks source link

修正查询缓存 #527

Closed Hhh0121 closed 4 months ago

Hhh0121 commented 7 months ago

image image 1:查询不存在的数据,首次查询返回null,后续返回false image image 2:查询不存在的json字段,首次查询返回null,后续报错 image 修正:1:cache缓存方法,应当不缓存数据为空的情况,已在value和column查询修正;2:当cacheAlways方法允许缓存空数据的情况,value方法应当缓存默认值,而不是false,会导致json数据解析报错 #468 #342 @liu21st

codecov-commenter commented 7 months ago

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 12.28%. Comparing base (e35f497) to head (17e6700).

Files Patch % Lines
src/db/PDOConnection.php 88.88% 2 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 #527 +/- ## ============================================ + Coverage 12.24% 12.28% +0.03% - Complexity 2965 2969 +4 ============================================ Files 64 64 Lines 7129 7131 +2 ============================================ + Hits 873 876 +3 + Misses 6256 6255 -1 ``` | [Flag](https://app.codecov.io/gh/top-think/think-orm/pull/527/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/527/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=top-think) | `12.28% <88.88%> (+0.03%)` | :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.

Hhh0121 commented 4 months ago

@liu21st 这个有问题吗,怎么关闭了