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']) {