From f93a4b0dba655d3b835c7074b7b2c4bfbdd10626 Mon Sep 17 00:00:00 2001 From: lq Date: Mon, 2 Dec 2024 09:16:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7php=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=90=8E=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v1/controllers/PrescripDetailController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/service/modules/v1/controllers/PrescripDetailController.php b/service/modules/v1/controllers/PrescripDetailController.php index ce5662f..cc7a74d 100644 --- a/service/modules/v1/controllers/PrescripDetailController.php +++ b/service/modules/v1/controllers/PrescripDetailController.php @@ -52,32 +52,32 @@ class PrescripDetailController extends BaseAppController } }]); - if($post['prescription_no']){ + if($post['prescription_no']?? false){ $query->andWhere(['p.prescription_no'=> $post['prescription_no']]); } - if($post['status'] ){ + if($post['status']?? false ){ $query->andWhere(['p.status'=> $post['status']]); }elseif($post['status']==='0'){ $query->andWhere(['p.status'=> $post['status']]); }else{ $query->andWhere(['p.status'=> [0,1,2]]); } - if($post['type']){ + if($post['type']?? false){ $query->andWhere(['p.type'=>$post['type']]); } - if($post['prescription_type']){ + if($post['prescription_type']?? false){ $query->andWhere(['p.prescription_type'=>$post['prescription_type']]); } - if($post['start_time']&&!$post['end_time']){ + if($post['start_time']?? false&&!$post['end_time']?? false){ $query->andWhere(['>=','p.created_at',strtotime($post['start_time'])]); } - if(!$post['start_time']&&$post['end_time']){ + if(!$post['start_time']?? false&&$post['end_time']?? false){ $query->andWhere(['<=','p.created_at',strtotime($post['end_time'])]); } - if($post['start_time']&&$post['end_time']){ + if($post['start_time']?? false&&$post['end_time']?? false){ $query->andWhere(['between','p.created_at',strtotime($post['start_time']),strtotime($post['end_time'])]); }