迁移并合并医生问诊评价接口
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace App\Services;
|
||||
|
||||
use App\Model\BasicBank;
|
||||
use App\Model\DiseaseClass;
|
||||
use App\Model\DiseaseClassExpertise;
|
||||
use App\Model\Hospital;
|
||||
use App\Model\HospitalDepartmentCustom;
|
||||
use App\Model\OperationManual;
|
||||
@@ -126,4 +128,46 @@ class BasicDataService extends BaseService
|
||||
|
||||
return success($operation_manual->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索疾病分类
|
||||
* @return array
|
||||
*/
|
||||
public function getDiseaseSearch(): array
|
||||
{
|
||||
$disease_class_name = $this->request->input('disease_class_name');
|
||||
|
||||
$params = array();
|
||||
$params[] = ["disease_class_status",1];
|
||||
$params[] = ["disease_class_enable",1];
|
||||
$params[] = ['disease_class_name', 'like', '%' . $disease_class_name . '%'];
|
||||
$disease_class = DiseaseClass::getList($params);
|
||||
|
||||
return empty($disease_class) ? success() : success($disease_class->toArray()) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取常见疾病分类
|
||||
* @return array
|
||||
*/
|
||||
public function getDiseaseHot(): array
|
||||
{
|
||||
$params = array();
|
||||
$params[] = ["disease_class_status",1];
|
||||
$params[] = ["disease_class_enable",1];
|
||||
$params[] = ['is_hot', 1];
|
||||
$disease_class = DiseaseClass::getLimit($params,10);
|
||||
|
||||
return empty($disease_class) ? success() : success($disease_class->toArray()) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 专长列表
|
||||
* @return array
|
||||
*/
|
||||
public function getDiseaseExpertiseList(): array
|
||||
{
|
||||
$disease_class_expertise = DiseaseClassExpertise::getOrderList();
|
||||
return success($disease_class_expertise);
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Model\DiseaseClass;
|
||||
use App\Model\DiseaseClassExpertise;
|
||||
use App\Request\DiseaseRequest;
|
||||
use App\Request\PatientFamilyRequest;
|
||||
|
||||
class DiseaseService extends BaseService
|
||||
{
|
||||
/**
|
||||
* 专长列表
|
||||
* @return array
|
||||
*/
|
||||
public function getDiseaseExpertiseList(): array
|
||||
{
|
||||
$disease_class_expertise = DiseaseClassExpertise::getOrderList();
|
||||
return success($disease_class_expertise);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索疾病分类
|
||||
* @return array
|
||||
*/
|
||||
public function getDiseaseSearch(): array
|
||||
{
|
||||
$disease_class_name = $this->request->input('disease_class_name');
|
||||
|
||||
$params = array();
|
||||
$params[] = ["disease_class_status",1];
|
||||
$params[] = ["disease_class_enable",1];
|
||||
$params[] = ['disease_class_name', 'like', '%' . $disease_class_name . '%'];
|
||||
$disease_class = DiseaseClass::getList($params);
|
||||
|
||||
return empty($disease_class) ? success() : success($disease_class->toArray()) ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取常见疾病分类
|
||||
* @return array
|
||||
*/
|
||||
public function getDiseaseHot(): array
|
||||
{
|
||||
$params = array();
|
||||
$params[] = ["disease_class_status",1];
|
||||
$params[] = ["disease_class_enable",1];
|
||||
$params[] = ['is_hot', 1];
|
||||
$disease_class = DiseaseClass::getLimit($params,10);
|
||||
|
||||
return empty($disease_class) ? success() : success($disease_class->toArray()) ;
|
||||
}
|
||||
}
|
||||
@@ -273,43 +273,6 @@ class PatientDoctorService extends BaseService
|
||||
return success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生评价
|
||||
* @return array
|
||||
*/
|
||||
public function getDoctorEvaluationList(): array
|
||||
{
|
||||
$doctor_id = $this->request->input('doctor_id');
|
||||
$page = $this->request->input('page', 1);
|
||||
$per_page = $this->request->input('per_page', 10);
|
||||
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['status'] = 1; // 状态(0:禁用 1:正常 2:删除)
|
||||
$params["iden_auth_status"] = 1;// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
$user_doctor = UserDoctor::getOne($params);
|
||||
if (empty($user_doctor)){
|
||||
return fail(HttpEnumCode::CLIENT_HTTP_ERROR);
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$order_evaluation = OrderEvaluation::getPage($params);
|
||||
|
||||
if (!empty($order_evaluation['data'])){
|
||||
foreach ($order_evaluation['data'] as &$data){
|
||||
// 处理综合评分
|
||||
if ($data['avg_score'] != 0){
|
||||
$data['avg_score'] = ceil($data['avg_score'] * 0.05 * 100) / 100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success($order_evaluation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 医生详情简介-详情中的简介
|
||||
* @return array
|
||||
|
||||
@@ -5,15 +5,19 @@ namespace App\Services;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\BasicBank;
|
||||
use App\Model\BasicWord;
|
||||
use App\Model\DiseaseClassExpertise;
|
||||
use App\Model\DiseaseClassIcd;
|
||||
use App\Model\DoctorAccount;
|
||||
use App\Model\DoctorBankCard;
|
||||
use App\Model\DoctorExpertise;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\DoctorWord;
|
||||
use App\Model\OrderEvaluation;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\OrderInquiryCase;
|
||||
use App\Model\OrderPrescription;
|
||||
use App\Model\User;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserDoctorInfo;
|
||||
use App\Utils\Mask;
|
||||
@@ -57,7 +61,6 @@ class UserDoctorService extends BaseService
|
||||
return success($disease_class_expertise);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取医生已选择专长
|
||||
* @param string $doctor_id
|
||||
@@ -513,6 +516,133 @@ class UserDoctorService extends BaseService
|
||||
return success($user_doctor);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取常用语列表
|
||||
* @return array
|
||||
*/
|
||||
public function getDoctorWords(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$words_type = $this->request->input('words_type');
|
||||
|
||||
$result = array();
|
||||
|
||||
// 获取系统常用语
|
||||
$params = array();
|
||||
$params['basics_words_type'] = $words_type;
|
||||
$params['basics_words_status'] = 1;
|
||||
$basic_words = BasicWord::getList($params);
|
||||
if (!empty($basic_words)){
|
||||
foreach ($basic_words as $item){
|
||||
$data = array();
|
||||
$data['words'] = $item['basics_words'];
|
||||
|
||||
$result[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取医生自定义常用语
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['words_type'] = $words_type;
|
||||
$params['words_status'] = 1;
|
||||
$doctor_words = DoctorWord::getList($params);
|
||||
if (!empty($doctor_words)){
|
||||
foreach ($doctor_words as $item){
|
||||
$data = array();
|
||||
$data['words'] = $item['words'];
|
||||
|
||||
$result[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增常用语列表
|
||||
* @return array
|
||||
*/
|
||||
public function addDoctorWords(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$words = $this->request->input('words');
|
||||
$words_type = $this->request->input('words_type');
|
||||
|
||||
// 查询是否重复
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['words_type'] = $words_type;
|
||||
$params['words'] = $words;
|
||||
$doctor_words = DoctorWord::getOne($params);
|
||||
if (!empty($doctor_words)){
|
||||
if ($doctor_words['words_status'] == 0){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"此常用语已被禁用");
|
||||
}else{
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"请勿重复添加");
|
||||
}
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['doctor_id'] = $user_info['client_user_id'];
|
||||
$data['words_type'] = $words_type;
|
||||
$data['words_status'] = 1;
|
||||
$data['sort'] = 0;
|
||||
$data['words'] = $words;
|
||||
|
||||
$doctor_words = DoctorWord::addDoctorWord($data);
|
||||
if (empty($doctor_words)){
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生评价
|
||||
* @return array
|
||||
*/
|
||||
public function getDoctorEvaluationList(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$doctor_id = $this->request->input('doctor_id');
|
||||
$evaluation_type = $this->request->input('evaluation_type',1);
|
||||
$page = $this->request->input('page',1);
|
||||
$per_page = $this->request->input('per_page',10);
|
||||
|
||||
if (empty($user_info)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
|
||||
// 4-5分为好评、3分为中评、2-1分为差评
|
||||
if ($evaluation_type == 1){
|
||||
// 全部
|
||||
$avg_score_params = [0,100];
|
||||
}elseif ($evaluation_type == 2){
|
||||
// 好评
|
||||
$avg_score_params = [80,100];
|
||||
}elseif ($evaluation_type == 3){
|
||||
// 中/差评
|
||||
$avg_score_params = [0,80];
|
||||
}else{
|
||||
return fail();
|
||||
}
|
||||
|
||||
$order_evaluation = OrderEvaluation::getScorePage($params,$avg_score_params);
|
||||
if (!empty($order_evaluation['data'])){
|
||||
foreach ($order_evaluation['data'] as &$item){
|
||||
$item['avg_score'] = floor($item['avg_score'] * 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
return success($order_evaluation);
|
||||
}
|
||||
/**
|
||||
* 检测医生身份认证
|
||||
* @param object|array $user_doctor 医生表数据
|
||||
|
||||
Reference in New Issue
Block a user