where($this->qualifyColumn('account_type'), $account->type) ->where($this->qualifyColumn('account_id'), $account->id); } public function isOwnedBy(AgentAccount $account): bool { return $this->account_type === $account->type && $this->account_id === $account->id; } /** * 这一行的账号。 */ public function account(): AgentAccount { return $this->account_type === 'user' ? AgentAccount::user($this->account_id) : AgentAccount::guest($this->account_id); } }