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()