增加公司信息
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-07-15 10:18:13 +08:00
parent 9c9242fcca
commit ed04b8772a
4 changed files with 38 additions and 0 deletions

View File

@ -144,4 +144,21 @@ class FirstCompanyRepository extends AbstractRepository
$this->dao->buildWhere($query, $params);
return $this->dao->paginate($query, compact('page', 'pageSize'));
}
/**
* 获取公司信息.
* @param int|string $companyId
* @return array|null
* @throws Exception
*/
public function companyInfo(int|string $companyId): ?array
{
$query = $this->dao->builder()
->where('id', '=', $companyId);
if (!$query->exists()) {
throw new ApiException('公司不存在');
}
return $query->first()?->toArray();
}
}