top-think / top-think/think-orm

mysql insert后获取不到主键id

Open
#830 0 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

测试代码

Image

修复文件:

  1. vendor/topthink/think-orm/src/Model.php
Image 2. vendor/topthink/think-orm/src/db/BaseQuery.php Image 3. vendor/topthink/think-orm/src/db/PDOConnection.php Image

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 MySQL insert case shown in the issue, then inspect vendor/topthink/think-orm/src/Model.php, vendor/topthink/think-orm/src/db/BaseQuery.php, and vendor/topthink/think-orm/src/db/PDOConnection.php. Compare the inserted record's primary-key result with the expected behavior in the attached test, and consider the issue done when the ID is available after insertion without breaking related ORM behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, php
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.