This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
@ -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'));
|
||||
}
|
||||
}
|
@ -63,5 +63,10 @@ return [
|
||||
'id' => 10,
|
||||
'action' => 'DeptController@updateDeptStatus',
|
||||
'name' => '部门状态更新',
|
||||
]
|
||||
],
|
||||
[
|
||||
'id' => 11,
|
||||
'action' => 'FrirstCompanyController@addFirstCompany',
|
||||
'name' => '新增|编辑平台公司',
|
||||
],
|
||||
];
|
@ -70,7 +70,7 @@ Router::addGroup('/api/v1', function () {
|
||||
Router::post('dept.update.status', [DeptController::class, 'updateDeptStatus']); # 部门状态
|
||||
|
||||
/**
|
||||
* 平台公司管理
|
||||
* 平台公司授权管理
|
||||
*/
|
||||
Router::post('company.module.add', [RoleController::class, 'addCompanyModule']); # 公司模块授权
|
||||
Router::post('company.permission.checked', [RoleController::class, 'companyChecked']); # 公司模块选择列表
|
||||
@ -84,6 +84,7 @@ Router::addGroup('/api/v1', function () {
|
||||
* 平台管理
|
||||
*/
|
||||
Router::post('company.add.first', [FirstCompanyController::class, 'addFirstCompany']); # 新增平台公司
|
||||
Router::post('company.list', [FirstCompanyController::class, 'companyList']); # 公司列表
|
||||
|
||||
/**
|
||||
* 供应商&客户管理
|
||||
|
Reference in New Issue
Block a user