From 4319f6dd5831cb01974de5808ad5df37bbea1909 Mon Sep 17 00:00:00 2001 From: yanzai Date: Wed, 24 Jul 2024 13:33:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=E3=80=81=E6=94=BE?= =?UTF-8?q?=E5=BC=80=E6=97=A5=E6=9C=9F=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/AppointmentController.php | 4 ++-- app/Http/Controllers/ComboItemController.php | 1 + app/Http/Controllers/UserOrderController.php | 20 ++++++++++++++++--- app/Http/Controllers/UserPersonController.php | 2 +- 北京国康小程序/pages/buy/check/check.vue | 10 +++++----- 北京国康小程序/pages/buy/time/time.vue | 5 +++++ 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/app/Http/Controllers/AppointmentController.php b/app/Http/Controllers/AppointmentController.php index 9530a4e..66b1a54 100644 --- a/app/Http/Controllers/AppointmentController.php +++ b/app/Http/Controllers/AppointmentController.php @@ -290,8 +290,8 @@ class AppointmentController extends Controller $month = $request->post('month'); $hospital = $request->post('hospital'); $appointments = Appointment::where('hospital', $hospital) - // ->where('date', 'like', $month . '%') - ->where('date', date('Y-m-d')) + ->where('date', 'like', $month . '%') + // ->where('date', date('Y-m-d')) ->where('status', 1) ->where('del', 2) ->orderBy('date') diff --git a/app/Http/Controllers/ComboItemController.php b/app/Http/Controllers/ComboItemController.php index caa9cb7..8aca9b2 100644 --- a/app/Http/Controllers/ComboItemController.php +++ b/app/Http/Controllers/ComboItemController.php @@ -33,6 +33,7 @@ class ComboItemController extends Controller 'end_time' => $group_info['预约结束日期'], 'group_name' => $group_info['单位名称'] . ($group_info['部门名称']), 'danwei_id' => $group_info['单位Id'], + 'fenzu_id' => $group_info['分组Id'], 'items' => $items, 'appointment_number' => $group_info['预约Id'] ]; diff --git a/app/Http/Controllers/UserOrderController.php b/app/Http/Controllers/UserOrderController.php index 574861b..3c7d196 100644 --- a/app/Http/Controllers/UserOrderController.php +++ b/app/Http/Controllers/UserOrderController.php @@ -227,12 +227,20 @@ class UserOrderController extends Controller //如果是团检并且选择了自选 $fenzu=false; + $self_fenzu=false; if(!!$group and count($items) != 0){ $data=[ "单位Id"=>$group_info['danwei_id'] ]; $peis = new PEISApiController(); $fenzu = $peis::Post('获取单位分组', $hospital, $data)['data'][0]; + if($fenzu !==false and isset($fenzu['分组'])){ + foreach ($fenzu['分组'] as $key=>$fenzu_item){ + if($fenzu_item['Id']==$group_info['fenzu_id']){ + $self_fenzu=$fenzu_item; + } + } + } } @@ -250,7 +258,7 @@ class UserOrderController extends Controller foreach ($items_list as $item) { if($fenzu !==false and isset($fenzu['分组'])){ - $item['price']=$item['price']*$fenzu['分组'][0]['增项折扣']; + $item['price']=$item['price']*$self_fenzu['增项折扣']; } @@ -307,9 +315,15 @@ class UserOrderController extends Controller } $true_price = $price; //如果是团检判断分组内的统收限额,超过限额的部分收费 - if(!!$fenzu and !!$fenzu['分组'][0]['统收限额'] and $fenzu['分组'][0]['统收限额']<$true_price){ - $true_price=$true_price-$fenzu['分组'][0]['统收限额']; + if(!!$self_fenzu and !!$self_fenzu['统收限额'] ){ + if($self_fenzu['统收限额']<$true_price){ + $true_price=$true_price-$self_fenzu['统收限额']; + + }else{ + $true_price=0; + } } + if (Login::$info->pay > 0 && $true_price > 0) { $true_price = Login::$info->pay; } diff --git a/app/Http/Controllers/UserPersonController.php b/app/Http/Controllers/UserPersonController.php index 15aac9e..db33a38 100644 --- a/app/Http/Controllers/UserPersonController.php +++ b/app/Http/Controllers/UserPersonController.php @@ -18,7 +18,7 @@ class UserPersonController extends Controller $id_number = $request->post('id_number'); $cic = new ComboItemController(); $info = $cic->group_info($hospital, [ - "电话号码" => $phone, +// "电话号码" => $phone, "证件号码" => $id_number, "预约Id" => null ]); diff --git a/北京国康小程序/pages/buy/check/check.vue b/北京国康小程序/pages/buy/check/check.vue index 46a7d1e..ccbefd7 100644 --- a/北京国康小程序/pages/buy/check/check.vue +++ b/北京国康小程序/pages/buy/check/check.vue @@ -143,18 +143,18 @@ icon:'none' }) } - getUserInfo() + // getUserInfo() }) } onShow(() => { uni.$lu.hospital((info) => { hospital.value = info - autoSelectTime() + // autoSelectTime() }) GetGreySet() - + getUserInfo() console.log(JSON.stringify($store.buy_info)) }) @@ -199,10 +199,10 @@ - + 体检时间 - {{ buy_info.time.id !== 0 ? buy_info.time.show : '今日已无可用名额'}} + {{ buy_info.time.id !== 0 ? buy_info.time.show : ' '}} diff --git a/北京国康小程序/pages/buy/time/time.vue b/北京国康小程序/pages/buy/time/time.vue index e8963c3..eb51b49 100644 --- a/北京国康小程序/pages/buy/time/time.vue +++ b/北京国康小程序/pages/buy/time/time.vue @@ -44,6 +44,11 @@ let date = calendar_ref.value.calendar.fullDate for (let i in appointment_list.value) { if (appointment_list.value[i].date === date) { + if(appointment_list.value[i].data.list.length==1){ + let info=appointment_list.value[i].data.list + if (info.max_count - info.used_count <= 0) return + $store.buy_info.time = info[0] + } return appointment_list.value[i].data.list } }