12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?php
- namespace app\admin\controller;
- use app\admin\service\ServiceTeamService;
- use app\admin\validate\sys_manage\DeptValidate;
- use support\Request;
- class ServiceTeamController
- {
- /**
- * @Desc 部门列表
- * @Author Gorden
- * @Date 2024/2/21 10:29
- *
- * @param Request $request
- * @return \support\Response
- */
- public function deptList(Request $request)
- {
- return ServiceTeamService::deptList($request);
- }
- /**
- * @Desc 部门详情
- * @Author Gorden
- * @Date 2024/2/21 10:35
- *
- * @param $id
- * @return \support\Response
- */
- public function deptInfo($id)
- {
- return ServiceTeamService::deptInfo($id);
- }
- /**
- * @Desc 创建部门
- * @Author Gorden
- * @Date 2024/2/21 9:22
- *
- * @param Request $request
- * @return \support\Response
- */
- public function addDept(Request $request)
- {
- $validate = new DeptValidate();
- if (!$validate->scene('service_team_add')->check($request->post())) {
- return json_fail($validate->getError());
- }
- return ServiceTeamService::insertDept($request->post());
- }
- /**
- * @Desc 修改部门
- * @Author Gorden
- * @Date 2024/2/21 10:15
- *
- * @param $id
- * @param Request $request
- * @return \support\Response
- */
- public function updateDept($id, Request $request)
- {
- $validate = new DeptValidate();
- if (!$validate->scene('service_team_update')->check($request->post())) {
- return json_fail($validate->getError());
- }
- return ServiceTeamService::updateDept($id, $request->post());
- }
- /**
- * @Desc 修改部门状态
- * @Author Gorden
- * @Date 2024/2/21 10:41
- *
- * @param $id
- * @param $status
- * @return \support\Response
- */
- public function updateStatus($id, Request $request)
- {
- $validate = new DeptValidate();
- if (!$validate->scene('update_status')->check($request->post())) {
- return json_fail($validate->getError());
- }
- return ServiceTeamService::updateStatus($id, $request->post('dept_status'));
- }
- public function delDept(Request $request)
- {
- return ServiceTeamService::delDept($request);
- }
- }
|