|
|
|
|
@ -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++;
|
|
|
|
|
}
|
|
|
|
|
|