top-think / top-think/think-orm
4.0.8模型一对一关联 append 失效,4.0.3是有效的;
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 437
- Forks
- 188
- PR merge metrics
- No merged PRs in 30d
Description
获取器 getFaviconUrlAttr 失效;查询结果 favicon_url 为空;
// 关联favicon文件
public function favicon()
{
return $this->hasOne(FileModel::class, 'file_id', 'favicon_id')->append(['file_url'])->where(where_disdel());
}
/**
* 获取favicon链接
* @Apidoc\Field("")
* @Apidoc\AddField("favicon_url", type="string", desc="favicon链接")
*/
public function getFaviconUrlAttr()
{
return $this['favicon']['file_url'] ?? '';
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the getFaviconUrlAttr accessor and the favicon relation shown in the issue, then compare their behavior between versions 4.0.8 and 4.0.3. Reproduce the query and inspect why the appended file_url is unavailable; done means the query result again contains a non-empty favicon_url when a favicon file exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100