diff --git a/service/modules/v1/controllers/PrescripDetailController.php b/service/modules/v1/controllers/PrescripDetailController.php index cc7a74d..dd907a8 100644 --- a/service/modules/v1/controllers/PrescripDetailController.php +++ b/service/modules/v1/controllers/PrescripDetailController.php @@ -69,15 +69,17 @@ class PrescripDetailController extends BaseAppController $query->andWhere(['p.prescription_type'=>$post['prescription_type']]); } - if($post['start_time']?? false&&!$post['end_time']?? false){ + $post['start_time'] = $post['start_time']?? false; + $post['end_time'] = $post['end_time']?? false; + if($post['start_time']&&!$post['end_time']){ $query->andWhere(['>=','p.created_at',strtotime($post['start_time'])]); } - if(!$post['start_time']?? false&&$post['end_time']?? false){ + if(!$post['start_time']&&$post['end_time']){ $query->andWhere(['<=','p.created_at',strtotime($post['end_time'])]); } - if($post['start_time']?? false&&$post['end_time']?? false){ + if($post['start_time']&&$post['end_time']){ $query->andWhere(['between','p.created_at',strtotime($post['start_time']),strtotime($post['end_time'])]); }