升级php版本后错误修复

This commit is contained in:
2024-12-02 09:16:59 +08:00
parent 53d4916005
commit f93a4b0dba

View File

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