diff --git a/niucloud/app/api/controller/apiController/PhysicalTest.php b/niucloud/app/api/controller/apiController/PhysicalTest.php new file mode 100644 index 00000000..340d7423 --- /dev/null +++ b/niucloud/app/api/controller/apiController/PhysicalTest.php @@ -0,0 +1,46 @@ +param('personnel_id', '');//员工人力资源表id(两个参数2选1) + $customer_resources_id = $request->param('customer_resources_id', '');//学生资源表id(两个参数2选1) + if (empty($personnel_id) && empty($customer_resources_id)) { + return fail('缺少参数'); + } + + $where = [ + 'personnel_id' => $personnel_id, + 'customer_resources_id' => $customer_resources_id, + ]; + + $res = (new ChatService())->getChatFriendsPage($where); + + return success($res); + } +} diff --git a/niucloud/app/service/api/apiService/PhysicalTestService.php b/niucloud/app/service/api/apiService/PhysicalTestService.php new file mode 100644 index 00000000..04254c09 --- /dev/null +++ b/niucloud/app/service/api/apiService/PhysicalTestService.php @@ -0,0 +1,95 @@ +getPageParam();//获取请求参数中的页码+分页数 + $page = $page_params['page']; + $limit = $page_params['limit']; + + $model = new ChatFriends(); + //判断用没有员工id + if (!empty($where['personnel_id'])) { + $model = $model->where('personnel_id', $where['personnel_id']); + } + + if (!empty($where['customer_resources_id'])) { + $model = $model->where('customer_resources_id', $where['customer_resources_id']); + } + + $data = $model + ->with([ + 'personnel', + 'customer', + ]) + ->paginate([ + 'list_rows' => $limit, + 'page' => $page, + ])->toArray(); + + return $data; + } + + //查询详情 + public function getTestInfo(array $where) + { + $model = new ChatFriends(); + //判断用没有员工id + if (!empty($where['personnel_id'])) { + $model = $model->where('personnel_id', $where['personnel_id']); + } + if (!empty($where['customer_resources_id'])) { + $model = $model->where('customer_resources_id', $where['customer_resources_id']); + } + $data = $model->find(); + + + if ($data) { + $data = $data->toArray(); + $res = [ + 'code' => 1, + 'msg' => '操作成功', + 'data' => $data + ]; + return $res; + } else { + $res = [ + 'code' => 0, + 'msg' => '暂无数据', + 'data' => [] + ]; + return $res; + } + } +} diff --git a/niucloud/app/service/api/apiService/TestService.php b/niucloud/app/service/api/apiService/TestService.php new file mode 100644 index 00000000..81629665 --- /dev/null +++ b/niucloud/app/service/api/apiService/TestService.php @@ -0,0 +1,95 @@ +getPageParam();//获取请求参数中的页码+分页数 + $page = $page_params['page']; + $limit = $page_params['limit']; + + $model = new ChatFriends(); + //判断用没有员工id + if (!empty($where['personnel_id'])) { + $model = $model->where('personnel_id', $where['personnel_id']); + } + + if (!empty($where['customer_resources_id'])) { + $model = $model->where('customer_resources_id', $where['customer_resources_id']); + } + + $data = $model + ->with([ + 'personnel', + 'customer', + ]) + ->paginate([ + 'list_rows' => $limit, + 'page' => $page, + ])->toArray(); + + return $data; + } + + //查询详情 + public function getTestInfo(array $where) + { + $model = new ChatFriends(); + //判断用没有员工id + if (!empty($where['personnel_id'])) { + $model = $model->where('personnel_id', $where['personnel_id']); + } + if (!empty($where['customer_resources_id'])) { + $model = $model->where('customer_resources_id', $where['customer_resources_id']); + } + $data = $model->find(); + + + if ($data) { + $data = $data->toArray(); + $res = [ + 'code' => 1, + 'msg' => '操作成功', + 'data' => $data + ]; + return $res; + } else { + $res = [ + 'code' => 0, + 'msg' => '暂无数据', + 'data' => [] + ]; + return $res; + } + } +}