top-think / top-think/think-orm

4.0.24 自动时间戳字段取出并没有进行转换

Open
#761 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
437
Forks
188
PR merge metrics
No merged PRs in 30d

Description

同一个 ThinkPHP 8项目 ,同样的代码,ORM 3.x 取出的时间戳字段会自动转换 4.x 不会还是原始数据写入没问题

Image

Config 和 模型类均已配置

protected function getOptions(): array
{
    return [
        'autoWriteTimestamp' => true,
        'createTime' => 'created_at',
        'updateTime' => 'updated_at',
        'deleteTime' => 'deleted_at',
    ];
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported ThinkPHP 8 behavior with the model and Config timestamp options shown in the issue, comparing timestamp retrieval in ORM 3.x and 4.x. Identify the relevant retrieval path and determine the expected converted value; done means retrieved timestamp fields are converted in 4.x while writes continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.