diff --git a/app/Services/PatientDoctorService.php b/app/Services/PatientDoctorService.php index 50b11f4..8dcb9c7 100644 --- a/app/Services/PatientDoctorService.php +++ b/app/Services/PatientDoctorService.php @@ -5,6 +5,8 @@ namespace App\Services; use App\Constants\DoctorTitleCode; use App\Constants\HttpEnumCode; use App\Model\DiseaseClassExpertise; +use App\Model\DoctorConfigFollowPackage; +use App\Model\DoctorConfigFollowPackageItem; use App\Model\DoctorExpertise; use App\Model\DoctorInquiryConfig; use App\Model\DoctorInquiryConfig as DoctorInquiryConfigModel; @@ -129,6 +131,32 @@ class PatientDoctorService extends BaseService // 头像 $user_doctor['avatar'] = addAliyunOssWebsite($user_doctor['avatar']); + + // 随访包配置 + foreach ($user_doctor['DoctorInquiryConfig'] as $key => $doctor_inquiry_config){ + if ($doctor_inquiry_config['inquiry_type'] == 1 && $doctor_inquiry_config['inquiry_mode'] == 9){ + $params = array(); + $params['doctor_id'] = $doctor_inquiry_config['doctor_id']; + $doctor_config_follow_package = DoctorConfigFollowPackage::getOne($params); + if (!empty($doctor_config_follow_package)) { + $params = array(); + $params['follow_package_id'] = $doctor_config_follow_package['follow_package_id']; + $doctor_config_follow_package_items = DoctorConfigFollowPackageItem::getList($params); + if (!empty($doctor_config_follow_package_items)) { + foreach ($doctor_config_follow_package_items as $k => $doctor_config_follow_package_item){ + if ($k == 0){ + $user_doctor['DoctorInquiryConfig'][$key]['inquiry_price'] = $doctor_config_follow_package_item['service_price']; + continue; + } + + if ($doctor_config_follow_package_item['service_price'] < $user_doctor['DoctorInquiryConfig'][$key]['inquiry_price']){ + $user_doctor['DoctorInquiryConfig'][$key]['inquiry_price'] = $doctor_config_follow_package_item['service_price']; + } + } + } + } + } + } } } return success($user_doctors);