From 55f24214624d569e23d3402e704e72e0916679ef Mon Sep 17 00:00:00 2001 From: "HDM58\\hdm58" Date: Thu, 28 Sep 2023 11:26:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B6=88=E6=81=AF=E8=BD=AE?= =?UTF-8?q?=E8=AF=A2=E6=96=B9=E6=B3=95=EF=BC=8C=E5=8E=BB=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E7=9A=84=E6=9F=A5=E8=AF=A2=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/home/controller/Index.php | 48 ----------------------------------- 1 file changed, 48 deletions(-) diff --git a/app/home/controller/Index.php b/app/home/controller/Index.php index 27ed64f..d634d70 100644 --- a/app/home/controller/Index.php +++ b/app/home/controller/Index.php @@ -22,60 +22,12 @@ class Index extends BaseController { if (request()->isAjax()) { $admin_id = $this->uid; - //发票待审核统计 - $invoice_map_check[] = ['check_status', '<', 2]; - $invoice_map_check[] = ['', 'exp', Db::raw("FIND_IN_SET('{$admin_id}',check_admin_ids)")]; - $invoice_map_check[] = ['delete_time', '=', 0]; - $invoice_count_check = Db::name('Invoice')->where($invoice_map_check)->count(); - $statistics['invoice_html_check'] = ' 您有' . $invoice_count_check . '条发票申请待审核'; - if ($invoice_count_check == 0) { - $statistics['invoice_html_check'] = ''; - } - - $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]; - $expense_map_check[] = ['', 'exp', Db::raw("FIND_IN_SET('{$admin_id}',check_admin_ids)")]; - $expense_map_check[] = ['delete_time', '=', 0]; - $expense_count_check = Db::name('Expense')->where($expense_map_check)->count(); - $statistics['expense_html_check'] = '您有' . $expense_count_check . '条报销单待审核'; - if ($expense_count_check == 0) { - $statistics['expense_html_check'] = ''; - } - //未读消息统计 $msg_map[] = ['to_uid', '=', $admin_id]; $msg_map[] = ['read_time', '=', 0]; $msg_map[] = ['status', '=', 1]; $msg_count = Db::name('Message')->where($msg_map)->count(); - $statistics['msg_html'] = '您有' . $msg_count . '条未读消息'; $statistics['msg_num'] = $msg_count; - if ($msg_count == 0) { - $statistics['msg_html'] = ''; - } - - foreach ($statistics as $key => $value) { - if (!$value) { - unset($statistics[$key]); - } - - } return to_assign(0, 'ok', $statistics); } else { $admin = Db::name('Admin')->where('id',$this->uid)->find();