From 0d58390441b95808db2057a2705ba6d68a2d15c2 Mon Sep 17 00:00:00 2001 From: hdm Date: Wed, 24 Aug 2022 14:33:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E5=BC=80=E5=8F=91=E7=A5=A8=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/home/controller/Index.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/app/home/controller/Index.php b/app/home/controller/Index.php index aa04d39..1cc0c72 100644 --- a/app/home/controller/Index.php +++ b/app/home/controller/Index.php @@ -29,15 +29,22 @@ class Index extends BaseController $statistics['invoice_html_check'] = ''; } - //发票待开具统计 - $invoice_map_open[] = ['open_time', '=', 0]; - $invoice_map_open[] = ['open_admin_id', '=', $admin_id]; - $invoice_map_open[] = ['delete_time', '=', 0]; - $invoice_count_open = Db::name('Invoice')->where($invoice_map_open)->count(); - $statistics['invoice_html_open'] = '您有' . $invoice_count_open . '条发票待开具'; - if ($invoice_count_open == 0) { - $statistics['invoice_html_open'] = ''; - } + $map = []; + $map[] = ['name', '=', 'finance_admin']; + $map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$admin_id}',conf_1)")]; + $count = Db::name('DataAuth')->where($map)->count(); + + $statistics['invoice_html_open'] = ''; + if($count>0 ||$admin_id == 1){ + //发票待开具统计 + $invoice_map_open[] = ['open_time', '=', 0]; + $invoice_map_open[] = ['check_status', '=', 2]; + $invoice_map_open[] = ['delete_time', '=', 0]; + $invoice_count_open = Db::name('Invoice')->where($invoice_map_open)->count(); + if ($invoice_count_open > 0) { + $statistics['invoice_html_open'] = '您有' . $invoice_count_open . '条发票待开具'; + } + } //待审核的报销统计 $expense_map_check[] = ['check_status', '<', 2];