-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
改进模型自动创建时间和更新时间 #525
改进模型自动创建时间和更新时间 #525
Conversation
NHZEX
commented
May 26, 2023
- 允许模型输入时间覆盖自动生成行为
- 改进模型的自动时间测试
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## 2.1 #525 +/- ##
============================================
- Coverage 65.20% 64.39% -0.81%
- Complexity 10987 10999 +12
============================================
Files 881 881
Lines 30050 30055 +5
============================================
- Hits 19594 19355 -239
- Misses 10456 10700 +244
☔ View full report in Codecov by Sentry. |
e0d2232
to
b2c4ad7
Compare
e3f525f
to
fbf52f9
Compare
src/Model/Model.php
Outdated
@@ -1028,6 +1030,7 @@ private static function parseSaveData($data, string $type, ?self $object = null) | |||
} | |||
$incrUpdate = $meta->isIncrUpdate(); | |||
$ids = $meta->getIds(); | |||
$microTime = microtime(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
创建时间和更新时间字段不一定存在,要不要把下面用到的的 $microTime
改成 $microTime ??=microtime(true)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看看这个改动
* update 模型自动时间支持传入覆盖 * 调整 * 兼容pg更改 * 修复更新时无法写入更新时间 * 修复测试 * 修复测试 * 移除多余的类型转换 * 改进pg的测试 * 修复格式 * 调整时间赋值时机 * 改进格式