From aee2a4d64735f2ab7bda8db685e465d550a01f1a Mon Sep 17 00:00:00 2001 From: lcc <805383944@qq.com> Date: Fri, 5 Sep 2025 17:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=90=E8=90=A5=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/api/organization/User.php | 13 ++++++- .../models/agent/pingan/Ain_users_model.php | 35 ++++++++++++++++++ .../models/agent/pingan/Fish_users_model.php | 36 +++++++++++++++++++ 3 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 common/models/agent/pingan/Ain_users_model.php create mode 100644 common/models/agent/pingan/Fish_users_model.php diff --git a/agent/admin/controllers/api/organization/User.php b/agent/admin/controllers/api/organization/User.php index 9ab249ff..c9710118 100644 --- a/agent/admin/controllers/api/organization/User.php +++ b/agent/admin/controllers/api/organization/User.php @@ -7,13 +7,23 @@ require_once COMMPATH . '/third_party/PHPExcel/IOFactory.php'; class User extends BaseController { const DEFAULT_ORG_TEAM_ID = 3; //默认机构团队id + public function __construct() { parent::__construct(); - $this->load->model('agent/pingan/pingan_users_model', 'pinganUsers'); + $this->load->model('agent/pingan/pingan_users_model'); $this->load->model('agent/organization/Organization_model', 'mdOrganization'); $this->load->model('area_model'); $this->load->model('agent/pingan/Pingan_sys_role_model', 'mdSysRole'); + $this->orgId = $this->input_param("orgId"); + if (!$this->orgId) { + $rows = $this->mdOrganization->select(['status' => 0, 'parentId' => 0], 'id desc', 1, 1, 'id,userTableModel'); + $mdOrganization = $rows[0]; + } else { + $mdOrganization = $this->mdOrganization->get(['id' => $this->orgId]); + } + $userTableModel = $mdOrganization['userTableModel']; + $this->load->model('agent/pingan/' . $userTableModel, 'pinganUsers'); } public function page_get() @@ -98,6 +108,7 @@ class User extends BaseController $res = Pingan_users_model::TYPE_CENTER; $this->return_response($res); } + public function orgNameList_get() { $this->return_response(Pingan_users_model::orgNameList); diff --git a/common/models/agent/pingan/Ain_users_model.php b/common/models/agent/pingan/Ain_users_model.php new file mode 100644 index 00000000..c5415ad7 --- /dev/null +++ b/common/models/agent/pingan/Ain_users_model.php @@ -0,0 +1,35 @@ +table_name, 'default'); + } + + /** + * 根据id获取数据 + * @param array() $ids + */ + public function get_map_by_ids($ids, $fileds = '') + { + $rows = []; + $ids = array_filter($ids); + if ($ids) { + if ($ids) { + $cf_ids = implode(',', $ids); + $where = [ + "id in ($cf_ids)" => null + ]; + $rows = $this->map('id', '', $where, '', '', '', $fileds); + } + } + return $rows; + } +} \ No newline at end of file diff --git a/common/models/agent/pingan/Fish_users_model.php b/common/models/agent/pingan/Fish_users_model.php new file mode 100644 index 00000000..d157811a --- /dev/null +++ b/common/models/agent/pingan/Fish_users_model.php @@ -0,0 +1,36 @@ +table_name, 'default'); + } + + /** + * 根据id获取数据 + * @param array() $ids + */ + public function get_map_by_ids($ids, $fileds = '') + { + $rows = []; + $ids = array_filter($ids); + if ($ids) { + if ($ids) { + $cf_ids = implode(',', $ids); + $where = [ + "id in ($cf_ids)" => null + ]; + $rows = $this->map('id', '', $where, '', '', '', $fileds); + } + } + return $rows; + } +} \ No newline at end of file