From 4804e3f9301af7e7bd8965771fd0c786fba964a0 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Thu, 21 Mar 2024 14:30:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4=E6=8E=A5?= =?UTF-8?q?=E8=AF=8A=E4=BA=BA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Model/SystemInquiryConfig.php | 9 +++++---- app/Services/DoctorInquiryService.php | 8 ++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/Model/SystemInquiryConfig.php b/app/Model/SystemInquiryConfig.php index fe85e20..5b69a1d 100644 --- a/app/Model/SystemInquiryConfig.php +++ b/app/Model/SystemInquiryConfig.php @@ -11,8 +11,9 @@ use Hyperf\Snowflake\Concern\Snowflake; /** * @property string $system_inquiry_config_id 主键id - * @property int $inquiry_type 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药) - * @property int $inquiry_mode 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员) + * @property int $inquiry_type 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 5:检测) + * @property int $inquiry_mode 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员 6:疑难会诊 7:附赠) + * @property int $default_work_num_day 默认每日接诊数量 * @property int $max_work_num_day 每日最大接诊数量 * @property string $inquiry_price 接诊价格 * @property string $min_inquiry_price 最低接诊价格(专家问诊) @@ -34,12 +35,12 @@ class SystemInquiryConfig extends Model /** * The attributes that are mass assignable. */ - protected array $fillable = ['system_inquiry_config_id', 'inquiry_type', 'inquiry_mode', 'max_work_num_day', 'inquiry_price', 'min_inquiry_price', 'max_inquiry_price', 'times_number', 'duration', 'created_at', 'updated_at']; + protected array $fillable = ['system_inquiry_config_id', 'inquiry_type', 'inquiry_mode', 'default_work_num_day', 'max_work_num_day', 'inquiry_price', 'min_inquiry_price', 'max_inquiry_price', 'times_number', 'duration', 'created_at', 'updated_at']; /** * The attributes that should be cast to native types. */ - protected array $casts = ['system_inquiry_config_id' => 'string', 'inquiry_type' => 'integer', 'inquiry_mode' => 'integer', 'max_work_num_day' => 'integer', 'times_number' => 'integer', 'duration' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime']; + protected array $casts = ['system_inquiry_config_id' => 'string', 'inquiry_type' => 'integer', 'inquiry_mode' => 'integer', 'max_work_num_day' => 'integer', 'times_number' => 'integer', 'duration' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'default_work_num_day' => 'integer']; protected string $primaryKey = "system_inquiry_config_id"; diff --git a/app/Services/DoctorInquiryService.php b/app/Services/DoctorInquiryService.php index 19bf518..853e429 100644 --- a/app/Services/DoctorInquiryService.php +++ b/app/Services/DoctorInquiryService.php @@ -58,9 +58,6 @@ class DoctorInquiryService extends BaseService // 接诊价格 $info['inquiry_price'] = 0; - // 接诊人数 - $info['work_num_day'] = 30; - // 系统问诊配置表 $params = array(); $params['inquiry_type'] = $inquiry_type; @@ -85,6 +82,9 @@ class DoctorInquiryService extends BaseService $info['inquiry_price'] = $inquiry_price[0]; } + + // 默认接诊人数 + $info['work_num_day'] = $system_inquiry_config['default_work_num_day'] ?: 0; } else { // 接诊价格 $info['inquiry_price'] = $doctor_inquiry_config['inquiry_price'] ?: 0; @@ -194,7 +194,7 @@ class DoctorInquiryService extends BaseService $data['inquiry_mode'] = $inquiry_mode; $data['is_enable'] = 1; // 是否启用(0:否 1:是) $data['last_enable_method'] = 1; // 最后开启方式(1:自己 2:后台) - $data['work_num_day'] = $system_inquiry_config['max_work_num_day'] ?: 0; + $data['work_num_day'] = $system_inquiry_config['default_work_num_day'] ?: 0; $data['inquiry_price'] = $system_inquiry_config['inquiry_price']; $doctor_inquiry_config = DoctorInquiryConfig::addInquiryConfig($data);