新增公司资料
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-07-14 16:03:05 +08:00
parent 780df7ffff
commit 9c9242fcca
4 changed files with 40 additions and 2 deletions

View File

@ -40,6 +40,21 @@ class FirstCompanyController extends AbstractController
$this->firstCompanyRepository->addCompany($data);
$this->opLogs('[添加公司]' . $data['full_name'] ?? '');
return $this->apiResponse->success();
}
/**
* 公司列表.
* @return Response
* @throws Exception
*/
public function companyList(): Response
{
[$page, $pageSize] = $this->getPage();
$params = $this->request->all();
$data = $this->firstCompanyRepository->getList($page, $pageSize, $params);
return $this->apiResponse->success($data);
}
}

View File

@ -127,4 +127,21 @@ class FirstCompanyRepository extends AbstractRepository
}
return $company ?? [];
}
/**
* 获取公司列表.
* @param int|string $page
* @param int|string $pageSize
* @param array $params
* @return array
* @throws Exception
*/
public function getList(int|string $page, int|string $pageSize, array $params = []): array
{
$fields = $this->dao->getFields();
$query = $this->dao->builder()->select($fields);
// 构建查询条件
$this->dao->buildWhere($query, $params);
return $this->dao->paginate($query, compact('page', 'pageSize'));
}
}