From 79e65c3d5a884ea099e2460336d8c384dbabf049 Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Fri, 28 Apr 2023 11:42:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BB=E7=94=9F=E8=81=8C?= =?UTF-8?q?=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Constants/DoctorTitleCode.php | 18 ++++++++++++++---- app/Controller/BasicDataController.php | 11 +++++++++++ app/Model/UserDoctor.php | 12 ++++++++++-- app/Services/BasicDataService.php | 20 ++++++++++++++++++++ app/Services/DoctorAuthService.php | 2 +- app/Services/PatientDoctorService.php | 1 - config/routes.php | 3 +++ 7 files changed, 59 insertions(+), 8 deletions(-) diff --git a/app/Constants/DoctorTitleCode.php b/app/Constants/DoctorTitleCode.php index 87f86f1..1035c21 100644 --- a/app/Constants/DoctorTitleCode.php +++ b/app/Constants/DoctorTitleCode.php @@ -14,22 +14,32 @@ use Hyperf\Constants\Annotation\Constants; class DoctorTitleCode extends AbstractConstants { /** - * @Message("执业医师") + * @Message("主任中医师") */ const LICENSED_PHYSICIAN = 1; /** - * @Message("主治医师") + * @Message("主任医师") */ const ATTENDING_DOCTOR = 2; /** - * @Message("副主任医师") + * @Message("副主任中医师") */ const DEPUTY_CHIEF_PHYSICIAN = 3; /** - * @Message("主任医师") + * @Message("副主任医师") */ const CHIEF_PHYSICIAN = 4; + + /** + * @Message("主治医师") + */ + const CHIEF_PHYSICIAN_5 = 5; + + /** + * @Message("住院医师") + */ + const CHIEF_PHYSICIAN_6 = 6; } diff --git a/app/Controller/BasicDataController.php b/app/Controller/BasicDataController.php index 7282917..97ae592 100644 --- a/app/Controller/BasicDataController.php +++ b/app/Controller/BasicDataController.php @@ -179,4 +179,15 @@ class BasicDataController extends AbstractController $data = $BasicDataService->getAgreementInfo(); return $this->response->json($data); } + + /** + * 获取医生职称数据 + * @return ResponseInterface + */ + public function getDoctorTitle(): ResponseInterface + { + $BasicDataService = new BasicDataService(); + $data = $BasicDataService->getDoctorTitle(); + return $this->response->json($data); + } } \ No newline at end of file diff --git a/app/Model/UserDoctor.php b/app/Model/UserDoctor.php index 0083fda..f3e743f 100644 --- a/app/Model/UserDoctor.php +++ b/app/Model/UserDoctor.php @@ -32,12 +32,12 @@ use Hyperf\Utils\Arr; * @property int $is_bind_bank 是否已绑定结算银行卡(0:否 1:是) * @property int $is_recommend 是否首页推荐(0:否 1:是) * @property string $avatar 头像 - * @property int $doctor_title 医生职称(1:执业医师 2:主治医师 3:副主任医师 4:主任医师) + * @property int $doctor_title 医生职称(1:主任中医师 2:主任医师 3:副主任中医师 4:副主任医师 5:主治医师 6:住院医师) * @property int $department_custom_id 科室id-自定义 * @property string $department_custom_name 科室名称(如未自己输入,填入标准科室名称) * @property string $department_custom_mobile 科室电话 * @property int $hospital_id 所属医院id - * @property int $served_patients_num 服务患者数量 + * @property int $served_patients_num 服务患者数量(订单结束时统计) * @property string $praise_rate 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5) * @property string $avg_response_time 平均响应时间(分钟制) * @property int $number_of_fans 被关注数量 @@ -108,6 +108,14 @@ class UserDoctor extends Model return $this->hasMany(OrderInquiry::class, "doctor_id", "doctor_id"); } +// /** +// * 关联职称表 +// */ +// public function BasicDoctorTitle(): HasOne +// { +// return $this->hasOne(BasicDoctorTitle::class, 'doctor_title_id', 'doctor_title_id'); +// } + /** * 获取医生信息-单条 * @param array $params diff --git a/app/Services/BasicDataService.php b/app/Services/BasicDataService.php index 2adbc94..e4c5fbd 100644 --- a/app/Services/BasicDataService.php +++ b/app/Services/BasicDataService.php @@ -4,6 +4,7 @@ namespace App\Services; use App\Model\BasicAgreement; use App\Model\BasicBank; +use App\Model\BasicDoctorTitle; use App\Model\BasicJob; use App\Model\BasicNation; use App\Model\DiseaseClass; @@ -346,4 +347,23 @@ class BasicDataService extends BaseService return success($basic_agreement->toArray()); } + + /** + * 获取医生职称数据 + * @return array + */ + public function getDoctorTitle(): array + { + $params = array(); + + $fields = [ + 'doctor_title_id', + 'doctor_title_name', + ]; + $basic_doctor_title = BasicDoctorTitle::getList($params,$fields); + if (empty($basic_doctor_title)){ + return success(); + } + return success($basic_doctor_title->toArray()); + } } \ No newline at end of file diff --git a/app/Services/DoctorAuthService.php b/app/Services/DoctorAuthService.php index 8e71835..66cfcd5 100644 --- a/app/Services/DoctorAuthService.php +++ b/app/Services/DoctorAuthService.php @@ -243,7 +243,7 @@ class DoctorAuthService extends BaseService 'department_custom_id', 'department_custom_name', 'department_custom_mobile', - 'doctor_title', + 'doctor_title_id', 'brief_introduction', 'be_good_at', ]; diff --git a/app/Services/PatientDoctorService.php b/app/Services/PatientDoctorService.php index e873f8a..bbefb06 100644 --- a/app/Services/PatientDoctorService.php +++ b/app/Services/PatientDoctorService.php @@ -59,7 +59,6 @@ class PatientDoctorService extends BaseService $doctor_params['status'] = 1; // 状态(0:禁用 1:正常 2:删除) $doctor_params["iden_auth_status"] = 1;// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败) -// $doctor_params["multi_point_status"] = 1;// 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败) $doctor_params["is_bind_bank"] = 1;// 是否已绑定结算银行卡(0:否 1:是) if (!empty($is_search_welfare_reception)){ diff --git a/config/routes.php b/config/routes.php index bb52bd9..714addf 100644 --- a/config/routes.php +++ b/config/routes.php @@ -537,6 +537,9 @@ Router::addGroup('/basic', function () { // 获取职业数据 Router::get('/job', [BasicDataController::class, 'getJob']); + + // 获取医生职称数据 + Router::get('/doctor/title', [BasicDataController::class, 'getDoctorTitle']); }); // 获取医生评价