From 88571803de7d07d1f3cbfeb94f057eefe6c6707f Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Wed, 29 May 2024 11:11:06 +0800 Subject: [PATCH] update --- .../controller/works/finance/ExpenseController.php | 10 +++++++--- .../controller/works/finance/InvoiceController.php | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/adminapi/controller/works/finance/ExpenseController.php b/app/adminapi/controller/works/finance/ExpenseController.php index 7bb6b73dd..d23e3eb4c 100644 --- a/app/adminapi/controller/works/finance/ExpenseController.php +++ b/app/adminapi/controller/works/finance/ExpenseController.php @@ -176,8 +176,12 @@ $data['detail'] = json_decode($data['detail'],true); $data['annex'] = json_decode($data['annex'],true); $data['total_amount'] = 0; - foreach ($data['detail'] as $v){ + foreach ($data['detail'] as &$v){ $data['total_amount'] += $v['amount']; + //1-交通费 2-住宿费 3-餐补费 4-招待费 5-汽油费 6-其他费 + $v['cate_name'] = match ($v['cate_id']){ + '1'=>'交通费', '2'=>'住宿费', '3'=>'餐补费', '4'=>'招待费', '5'=>'汽油费', '6'=>'其他费', default=>'' + }; } $data['admin_name'] = Admin::where('id',$data['admin_id'])->value('name'); $data['flow_info'] = OaFlow::where('id',$data['flow_id'])->findOrEmpty(); @@ -232,7 +236,7 @@ $where[] = ['create_time','between',[strtotime($params['start_time']),strtotime($params['end_time'])]]; } if(!empty($params['status'])){ - $where[] = match ($params['status']){ + $where[] = match ((int)$params['status']){ 1=> ['check_status','=',0], //待审核 2=> ['check_status','=',1], //审核中 3=> [['check_status','=',2],['pay_admin_id','=',0],['pay_time','=',0]], //审批通过,待打款 @@ -689,7 +693,7 @@ $where[] = ['create_time','between',[strtotime($params['start_time']),strtotime($params['end_time'])]]; } if(!empty($params['status'])){ - $where[] = match ($params['status']){ + $where[] = match ((int)$params['status']){ 1=> [['check_status','=',2],['pay_admin_id','=',0],['pay_time','=',0]], //审批通过,待打款 2=> [['check_status','=',2],['pay_admin_id','>',0],['pay_time','>',0]], //审批通过,已打款 }; diff --git a/app/adminapi/controller/works/finance/InvoiceController.php b/app/adminapi/controller/works/finance/InvoiceController.php index 5010fdaf2..d412a1adf 100644 --- a/app/adminapi/controller/works/finance/InvoiceController.php +++ b/app/adminapi/controller/works/finance/InvoiceController.php @@ -169,7 +169,7 @@ $where[] = ['create_time','between',[strtotime($params['start_time']),strtotime($params['end_time'])]]; } if(!empty($params['status'])){ - $where[] = match ($params['status']){ + $where[] = match ((int)$params['status']){ 1=> ['check_status','=',0], //待审核 2=> ['check_status','=',1], //审核中 3=> [['check_status','=',2]], //审批通过,待开具 @@ -680,7 +680,7 @@ $where[] = ['create_time','between',[strtotime($params['start_time']),strtotime($params['end_time'])]]; } if(!empty($params['status'])){ - $where[] = match ($params['status']){ + $where[] = match ((int)$params['status']){ 1=> ['check_status','=',2], //审批通过,待开具 2=> ['check_status','=',5], //审批通过,已开具 3=> [['check_status','=',10]], //已作废