1即有权限 function isAuthExpense($uid) { if($uid == 1){ return 1; } $map = []; $map[] = ['name', '=', 'finance_admin']; $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',uids)")]; $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; } //是否是到账管理员,count>1即有权限 function isAuthIncome($uid) { if($uid == 1){ return 1; } $map = []; $map[] = ['name', '=', 'finance_admin']; $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',conf_2)")]; $count = Db::name('DataAuth')->where($map)->count(); return $count; } //读取开票主体 function finance_invoice_subject() { $subject = Db::name('InvoiceSubject')->where(['status' => 1])->order('id desc')->select()->toArray(); return $subject; } //读取报销类型 function finance_expense_cate() { $cate = Db::name('ExpenseCate')->where(['status' => 1])->order('id desc')->select()->toArray(); return $cate; }