From ce8896c140f26df55a6799a33f5be12335dece13 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Thu, 16 May 2024 14:32:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=8C=BB=E7=94=9F=E9=97=AE=E8=AF=8A=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=20=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=BA=86?= =?UTF-8?q?=E5=85=AC=E7=9B=8A=E9=97=AE=E8=AF=8A=E7=9A=84=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Command/AdjustDoctorInquiryPriceCommand.php | 14 ++++++++++++++ app/Services/DoctorInquiryService.php | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/app/Command/AdjustDoctorInquiryPriceCommand.php b/app/Command/AdjustDoctorInquiryPriceCommand.php index 178a663..5c5f5b6 100644 --- a/app/Command/AdjustDoctorInquiryPriceCommand.php +++ b/app/Command/AdjustDoctorInquiryPriceCommand.php @@ -4,7 +4,9 @@ declare(strict_types=1); namespace App\Command; +use App\Constants\HttpEnumCode; use App\Model\DoctorInquiryConfig; +use App\Model\DoctorInquiryPriceRecord; use App\Model\UserDoctor; use Hyperf\Command\Command as HyperfCommand; use Hyperf\Command\Annotation\Command; @@ -91,6 +93,18 @@ class AdjustDoctorInquiryPriceCommand extends HyperfCommand $data['work_num_day'] = 3; DoctorInquiryConfig::editInquiryConfig($params,$data); + // 记录修改记录 + $data = array(); + $data['doctor_id'] = $doctor_inquiry_config['doctor_id']; + $data['inquiry_config_id'] = $doctor_inquiry_config['inquiry_config_id']; + $data['old_price'] = $doctor_inquiry_config['inquiry_price']; + $data['new_price'] = $doctor_inquiry_config['inquiry_price'] + 5; + $doctor_inquiry_price_record = DoctorInquiryPriceRecord::addRecord($data); + if (empty($doctor_inquiry_price_record)) { + Db::rollBack(); + $this->line("添加记录失败"); + } + // 添加缓存记录该医生已处理 $redis->set($redis_key, 1, 60 * 60 * 24 * 1); diff --git a/app/Services/DoctorInquiryService.php b/app/Services/DoctorInquiryService.php index c8af56e..140ad11 100644 --- a/app/Services/DoctorInquiryService.php +++ b/app/Services/DoctorInquiryService.php @@ -520,6 +520,12 @@ class DoctorInquiryService extends BaseService // 验证-问诊价格 // 义诊时不判断,义诊为选择价格,价格后台可调节 + if ($inquiry_type == 3 && $inquiry_price == 0) { + if ($doctor['is_welfare_cooperation'] != 1){ + return fail(HttpEnumCode::HTTP_ERROR, "请联系客服开通权限~"); + } + } + if ($inquiry_type != 3) { if (!empty($system_inquiry_config['min_inquiry_price']) && !empty($system_inquiry_config['max_inquiry_price'])) { if ($inquiry_price > $system_inquiry_config['max_inquiry_price'] || $inquiry_price < $system_inquiry_config['min_inquiry_price']) {