From 3e9246d73a9dac841ed64142dde1a519b6712a5f Mon Sep 17 00:00:00 2001 From: yanzai Date: Mon, 14 Jul 2025 21:47:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E5=BA=9F=E6=81=A2=E5=A4=8D=E5=8F=B7?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/Admin/YeWu/WorkMainController.php | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php index 350275b..aa1e5f0 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php @@ -271,6 +271,42 @@ class WorkMainController extends Controller //检查是否有超时未支付的门诊预约记录,如果有则给其取消,并恢复名额 public function NoPayCancel() { + $success_count=0; + //检测是否有作废医嘱 + $list_zuofei=DB::table('s_list')->where(['list_status'=>1,'is_del'=>0,'is_nullify'=>1])->get(); + foreach ($list_zuofei as $key=>$item){ + $u_data=[ + 'list_status' => 0, + 'reservation_date' => null, + 'reservation_time' => null, + 'reservation_sources' => null, + 'services_group' => null, + 'roster_id' => null, + 'xuhao' => null, + 'department_id'=>null, + 'appointment_type_id' => null, + 'canel_time' => date('Y-m-d H:i:s'), + ]; + $u_mainList = DB::table('s_list')->where(['id' => $item->id,'list_status'=>1])->update($u_data); + $i_log=DB::table('s_list_log')->insert([ + 'list_id'=>$item->id, + 'reg_num'=>$item->reg_num, + 'old_status'=>$item->list_status, + 'new_status'=>0, + 'create_user'=>null, + 'note'=>'作废取消', + 'data'=>json_encode($u_data) + ]); + $u_count=false; + if($u_mainList){ + $u_count = DB::table('s_source_roster_detail_count')->where(['roster_detail_id' => $item->roster_id, 'appointment_type_id' => $item->appointment_type_id])->decrement('used_count'); + } + if($u_count){ + $success_count++; + } + } + + //检测是否有超时未支付的 date_default_timezone_set('PRC'); $config=DB::table('configs')->where(['label'=>'门诊缴费超时时间'])->first(); if($config->value>0){ @@ -281,7 +317,7 @@ class WorkMainController extends Controller $query->whereDate('entrust_date', $currentDateTime->toDateString()) ->whereTime('entrust_time', '<', $currentDateTime->toTimeString()); })->get(); - $success_count=0; + foreach ($list as $key=>$item){ $u_data=[ @@ -306,7 +342,10 @@ class WorkMainController extends Controller 'note'=>'超时取消', 'data'=>json_encode($u_data) ]); - $u_count = DB::table('s_source_roster_detail_count')->where(['roster_detail_id' => $item->roster_id, 'appointment_type_id' => $item->appointment_type_id])->decrement('used_count'); + $u_count=false; + if($u_mainList){ + $u_count = DB::table('s_source_roster_detail_count')->where(['roster_detail_id' => $item->roster_id, 'appointment_type_id' => $item->appointment_type_id])->decrement('used_count'); + } if($u_count){ $success_count++; }