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'])]); }