top-think / top-think/think-orm

4.0.8模型一对一关联 append 失效,4.0.3是有效的;

Open
#707 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

获取器 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

  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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.