修改医生端首页接口
This commit is contained in:
parent
0a8aa6040f
commit
ba5c7d31f2
@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Amqp\Producer\PrescriptionDistributePhProducer;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Model\OrderPrescriptionIcd;
|
||||
use App\Model\OrderPrescriptionProduct;
|
||||
|
||||
@ -54,14 +54,14 @@ class DoctorInquiryConfig extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生接诊配置信息-单条
|
||||
* 获取医生接诊配置信息
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getInquiryConfigOne(array $params, array $fields = ['*']): object|null
|
||||
public static function getInquiryConfigList(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::where($params)->first($fields);
|
||||
return self::where($params)->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,7 +72,7 @@ class DoctorInquiryConfig extends Model
|
||||
* @param array $inquiry_type_in_params
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getInquiryConfigList(array $params, array $fields = ['*'] , array $inquiry_type_in_params = [1,3]): object|null
|
||||
public static function getInquiryConfigListByInquiryType(array $params, array $fields = ['*'] , array $inquiry_type_in_params = [1,3]): object|null
|
||||
{
|
||||
return self::where($params)->whereIn("inquiry_type",$inquiry_type_in_params)->get($fields);
|
||||
}
|
||||
|
||||
@ -20,6 +20,112 @@ use Hyperf\Utils\WaitGroup;
|
||||
*/
|
||||
class IndexService extends BaseService
|
||||
{
|
||||
// /**
|
||||
// * 医生端-首页
|
||||
// * @return array
|
||||
// */
|
||||
// public function getDoctorIndex(): array
|
||||
// {
|
||||
// $user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
//
|
||||
// // 获取医生数据
|
||||
// $params = array();
|
||||
// $params['doctor_id'] = $user_info['client_user_id'];
|
||||
//
|
||||
// $fields = [
|
||||
// "doctor_id",
|
||||
// "user_id",
|
||||
// "user_name",
|
||||
// "open_id",
|
||||
// "status",
|
||||
// "idcard_status",
|
||||
// "iden_auth_status",
|
||||
// "iden_auth_fail_reason",
|
||||
// "multi_point_status",
|
||||
// "is_bind_bank",
|
||||
// "praise_rate",
|
||||
// "avg_response_time",
|
||||
// "number_of_fans",
|
||||
// "avatar",
|
||||
// "is_online",
|
||||
// "is_img_expert_reception",
|
||||
// "is_img_welfare_reception",
|
||||
// "is_img_quick_reception",
|
||||
// ];
|
||||
//
|
||||
// $doctor = UserDoctorModel::getOne($params, $fields);
|
||||
// if (empty($doctor)) {
|
||||
// return fail(HttpEnumCode::USER_STATUS_ERROR);
|
||||
// }
|
||||
//
|
||||
// if ($doctor['status'] == 0){
|
||||
// return fail(HttpEnumCode::USER_STATUS_DISABLE);
|
||||
// }
|
||||
//
|
||||
// if ($doctor['status'] != 1){
|
||||
// return fail(HttpEnumCode::USER_STATUS_ERROR);
|
||||
// }
|
||||
//
|
||||
// $InquiryService = new InquiryService();
|
||||
// $OrderPrescriptionService = new OrderPrescriptionService();
|
||||
//
|
||||
// // 获取未接诊患者个数
|
||||
// $not_accepted_inquiry_num = $InquiryService->getDoctorNotAcceptedInquiryNum($doctor['doctor_id']);
|
||||
//
|
||||
// // 获取接诊中患者个数
|
||||
// $accepting_inquiry_num = $InquiryService->getDoctorAcceptingInquiryNum($doctor['doctor_id']);
|
||||
//
|
||||
// // 获取被驳回处方数据
|
||||
// $reject_prescription_number = $OrderPrescriptionService->getDoctorExistsAuditFail($doctor['doctor_id']);
|
||||
//
|
||||
// // 获取医生问诊价格
|
||||
// $params = array();
|
||||
// $params['doctor_id'] = $doctor['doctor_id'];
|
||||
// $params['inquiry_type'] = 1;// 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊)
|
||||
// $params['inquiry_mode'] = 1;// 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
// $doctor_inquiry_config = DoctorInquiryConfigModel::getOne($params);
|
||||
//
|
||||
// // 获取banner
|
||||
// $params = array();
|
||||
// $params["app_type"] = 1;
|
||||
// $params["client_type"] = 2;
|
||||
// $params["banner_place"] = 1;
|
||||
// $params["banner_status"] = 1;
|
||||
// $banner = BannerModel::getList($params);
|
||||
// if (!empty($banner)){
|
||||
// foreach ($banner as &$item){
|
||||
// $item['banner_path'] = addAliyunOssWebsite($item['banner_path']);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 处理返回数据
|
||||
// $info = array();
|
||||
// $info['doctor_id'] = $doctor['doctor_id'];
|
||||
// $info['user_name'] = $doctor['user_name'];
|
||||
// $info['status'] = $doctor['status'];
|
||||
// $info['idcard_status'] = $doctor['idcard_status'];// 实名认证状态(0:未认证 1:认证通过 2:认证失败)
|
||||
// $info['iden_auth_status'] = $doctor['iden_auth_status'];// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
// $info['multi_point_status'] = $doctor['multi_point_status'];// 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
// $info['is_bind_bank'] = $doctor['is_bind_bank'];// 是否已绑定结算银行卡(0:否 1:是)
|
||||
// $info['avatar'] = addAliyunOssWebsite($doctor['avatar']);
|
||||
// $info['is_img_expert_reception'] = $doctor['is_img_expert_reception'];// 是否参加专家图文接诊(0:否 1:是)
|
||||
// $info['is_img_welfare_reception'] = $doctor['is_img_welfare_reception'];// 是否参加公益图文问诊(0:否 1:是)
|
||||
// $info['is_img_quick_reception'] = $doctor['is_img_quick_reception'];// 是否参加快速图文接诊(0:否 1:是)
|
||||
// $info['praise_rate'] = $doctor['praise_rate'];// 好评率(百分制。回复质量占4、服务态度占3、回复速度占3。每周计算一次)
|
||||
// $info['avg_response_time'] = (float)ceil($doctor['avg_response_time']);;// 平均响应时间(分钟制)
|
||||
// $info['number_of_fans'] = $doctor['number_of_fans'];// 被关注数量
|
||||
// $info['inquiry_price'] = $doctor_inquiry_config['inquiry_price'] ?? "";// 在线问诊价格
|
||||
// $info['not_accepted_inquiry_num'] = $not_accepted_inquiry_num ?? 0;// 获取未接诊患者个数
|
||||
// $info['accepting_inquiry_num'] = $accepting_inquiry_num ?? 0;// 获取接诊中患者个数
|
||||
// $info['reject_prescription_number'] = $reject_prescription_number ?? 0;// 获取被驳回处方数据
|
||||
//
|
||||
// $data = array();
|
||||
// $data['banner'] = $banner ?? [];// banner
|
||||
// $data['info'] = $info;// 医生数据
|
||||
//
|
||||
// return success($data);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 医生端-首页
|
||||
* @return array
|
||||
@ -47,10 +153,6 @@ class IndexService extends BaseService
|
||||
"avg_response_time",
|
||||
"number_of_fans",
|
||||
"avatar",
|
||||
"is_online",
|
||||
"is_img_expert_reception",
|
||||
"is_img_welfare_reception",
|
||||
"is_img_quick_reception",
|
||||
];
|
||||
|
||||
$doctor = UserDoctorModel::getOne($params, $fields);
|
||||
@ -78,12 +180,19 @@ class IndexService extends BaseService
|
||||
// 获取被驳回处方数据
|
||||
$reject_prescription_number = $OrderPrescriptionService->getDoctorExistsAuditFail($doctor['doctor_id']);
|
||||
|
||||
// 获取医生问诊价格
|
||||
// 在线问诊价格
|
||||
$inquiry_price = "";
|
||||
|
||||
// 获取医生问诊配置
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor['doctor_id'];
|
||||
$params['inquiry_type'] = 1;// 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊)
|
||||
$params['inquiry_mode'] = 1;// 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
$doctor_inquiry_config = DoctorInquiryConfigModel::getOne($params);
|
||||
$doctor_inquiry_config = DoctorInquiryConfigModel::getInquiryConfigList($params);
|
||||
foreach ($doctor_inquiry_config as $value){
|
||||
// 获取在线问诊设置的价格
|
||||
if ($value['inquiry_type'] == 1 && $value['inquiry_mode'] == 1){
|
||||
$inquiry_price = $value['inquiry_price'];
|
||||
}
|
||||
}
|
||||
|
||||
// 获取banner
|
||||
$params = array();
|
||||
@ -98,6 +207,7 @@ class IndexService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
// 处理返回数据
|
||||
$info = array();
|
||||
$info['doctor_id'] = $doctor['doctor_id'];
|
||||
$info['user_name'] = $doctor['user_name'];
|
||||
@ -107,13 +217,10 @@ class IndexService extends BaseService
|
||||
$info['multi_point_status'] = $doctor['multi_point_status'];// 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
$info['is_bind_bank'] = $doctor['is_bind_bank'];// 是否已绑定结算银行卡(0:否 1:是)
|
||||
$info['avatar'] = addAliyunOssWebsite($doctor['avatar']);
|
||||
$info['is_img_expert_reception'] = $doctor['is_img_expert_reception'];// 是否参加专家图文接诊(0:否 1:是)
|
||||
$info['is_img_welfare_reception'] = $doctor['is_img_welfare_reception'];// 是否参加公益图文问诊(0:否 1:是)
|
||||
$info['is_img_quick_reception'] = $doctor['is_img_quick_reception'];// 是否参加快速图文接诊(0:否 1:是)
|
||||
$info['praise_rate'] = $doctor['praise_rate'];// 好评率(百分制。回复质量占4、服务态度占3、回复速度占3。每周计算一次)
|
||||
$info['avg_response_time'] = (float)ceil($doctor['avg_response_time']);;// 平均响应时间(分钟制)
|
||||
$info['number_of_fans'] = $doctor['number_of_fans'];// 被关注数量
|
||||
$info['inquiry_price'] = $doctor_inquiry_config['inquiry_price'] ?? "";// 在线问诊价格
|
||||
$info['inquiry_price'] = $inquiry_price;// 在线问诊价格
|
||||
$info['not_accepted_inquiry_num'] = $not_accepted_inquiry_num ?? 0;// 获取未接诊患者个数
|
||||
$info['accepting_inquiry_num'] = $accepting_inquiry_num ?? 0;// 获取接诊中患者个数
|
||||
$info['reject_prescription_number'] = $reject_prescription_number ?? 0;// 获取被驳回处方数据
|
||||
@ -121,6 +228,7 @@ class IndexService extends BaseService
|
||||
$data = array();
|
||||
$data['banner'] = $banner ?? [];// banner
|
||||
$data['info'] = $info;// 医生数据
|
||||
$data['doctor_inquiry_config'] = $doctor_inquiry_config;// 医生问诊配置
|
||||
|
||||
return success($data);
|
||||
}
|
||||
|
||||
@ -248,7 +248,7 @@ class PatientDoctorService extends BaseService
|
||||
$inquiry_type_in_params[] = 3;
|
||||
}
|
||||
|
||||
$doctor_inquiry_config = DoctorInquiryConfigModel::getInquiryConfigList($params,['*'],$inquiry_type_in_params);
|
||||
$doctor_inquiry_config = DoctorInquiryConfigModel::getInquiryConfigListByInquiryType($params,['*'],$inquiry_type_in_params);
|
||||
if (!empty($doctor_inquiry_config)) {
|
||||
foreach ($doctor_inquiry_config as &$value) {
|
||||
// 获取医生当日的全部订单
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user