From 9cd1290ac8e32a46c03c9370653fa3eab036f034 Mon Sep 17 00:00:00 2001 From: vguanyiwgd Date: Mon, 22 Jul 2024 17:38:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=B9=E9=87=8F=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=EF=BC=8C=E5=8F=AA=E8=83=BD=E7=9C=8B=E8=A7=81=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E7=9A=84=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I54fa2f1c61357e87909cef87dfb223bfa501f6c9 --- backstage/application/backstage/controllers/Recharge.php | 9 ++++++++- .../application/backstage/models/Recharge_model.php | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/backstage/application/backstage/controllers/Recharge.php b/backstage/application/backstage/controllers/Recharge.php index e8711e0..f07eaa0 100644 --- a/backstage/application/backstage/controllers/Recharge.php +++ b/backstage/application/backstage/controllers/Recharge.php @@ -804,6 +804,13 @@ class Recharge extends CI_Controller { $this->load->library('lw_pagination2'); $jobId = $this->input->post('jobId'); + + // 判断管理员 roleID 是否 = 1,如果不是就要限制只能看当前管理员的job_id + $where = ''; + if($this->session->roleId != '1'){ + $where = " and d.admin_id = '".$this->session->adminId."'"; + } + $sql = "SELECT a.id, a.job_id, @@ -823,7 +830,7 @@ class Recharge extends CI_Controller LEFT JOIN tb_user b ON a.user_id = b.id LEFT JOIN tb_area c on b.area_id = c.id ,tb_jf_recharge_job d - WHERE a.job_id = d.id and a.job_id = {$jobId}"; + WHERE a.job_id = d.id and a.job_id = {$jobId} {$where}"; $param = null; $hasWhere = true; $group = null; diff --git a/backstage/application/backstage/models/Recharge_model.php b/backstage/application/backstage/models/Recharge_model.php index ebf877d..e5cb5e8 100644 --- a/backstage/application/backstage/models/Recharge_model.php +++ b/backstage/application/backstage/models/Recharge_model.php @@ -308,7 +308,7 @@ class Recharge_model extends CI_Model $where .= " and recharge_type_id = " . $data['recharge_type_id']; } if (!$this->admin_model->chk_system_role($this->session->userdata['roleId'])) { - $where .= " and a.company_id = " . $this->session->userdata("companyId"); + $where .= " and a.company_id = " . $this->session->userdata("companyId") . " and jrj.admin_id=" . $this->session->userdata("adminId") . " "; } $sql = "SELECT