top-think / top-think/think-orm

模型使用suffix设置后缀时,后缀为0会设置无效

Open
#651 1 comment 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

模型使用suffix方法设置表后缀时,如果后缀为0,会设置失败。
getSuffix方法获取表后缀时,会把0当空值处理

public function getSuffix(): string
{
return $this->suffix ?: '';
}

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

Search the ORM codebase for getSuffix() and the suffix setter, then trace how the table suffix is stored and read. Verify that a suffix of 0 remains valid rather than being treated as empty, and run the relevant existing ORM tests or add coverage for the zero-suffix case.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.