From 653ea397cfde788cc81fd192bb05d059d0cf00a2 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Fri, 3 Nov 2023 17:43:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BC=80=E7=A5=A8=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/common.php | 13 +++++++++++++ app/api/controller/FinanceExpense.php | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/api/common.php b/app/api/common.php index dc04ebe..dede962 100644 --- a/app/api/common.php +++ b/app/api/common.php @@ -104,3 +104,16 @@ function isAuthExpense($uid) $count = Db::name('DataAuth')->where($map)->count(); return $count; } + +//是否是发票管理员,count>1即有权限 +function isAuthInvoice($uid) +{ + if($uid == 1){ + return 1; + } + $map = []; + $map[] = ['name', '=', 'finance_admin']; + $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',conf_1)")]; + $count = Db::name('DataAuth')->where($map)->count(); + return $count; +} diff --git a/app/api/controller/FinanceExpense.php b/app/api/controller/FinanceExpense.php index 5987e60..a032db2 100644 --- a/app/api/controller/FinanceExpense.php +++ b/app/api/controller/FinanceExpense.php @@ -383,16 +383,16 @@ class FinanceExpense extends ApiController } } - //获取报销流程 - public function get_expense_flow() - { + //获取报销流程 + public function get_expense_flow() + { $this->uid = JWT_UID; $loginAdmin = Db::name('Admin')->where(['id' => $this->uid])->find(); $this->did = $loginAdmin['did']; $department = $this->did; $flows = get_type_department_flows(6, $department); $this->apiSuccess('获取成功', $flows); - } + } //查看 public function view()