This commit is contained in:
weiz 2024-05-29 11:11:06 +08:00
parent fd83deb396
commit 88571803de
2 changed files with 9 additions and 5 deletions

View File

@ -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]], //审批通过,已打款
};

View File

@ -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]], //已作废