This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user