修改医生列表、修改上报数据
This commit is contained in:
parent
340a447a83
commit
7479355def
@ -219,13 +219,8 @@ class UserDoctor extends Model
|
|||||||
{
|
{
|
||||||
$query = self::with([
|
$query = self::with([
|
||||||
"Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id",
|
"Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id",
|
||||||
"DoctorExpertise" => function ($query) use ($doctor_expertise_params) {
|
"DoctorExpertise",
|
||||||
$query->where($doctor_expertise_params);
|
|
||||||
},
|
|
||||||
"DoctorInquiryConfig" => function ($query) use ($sort_order) {
|
"DoctorInquiryConfig" => function ($query) use ($sort_order) {
|
||||||
$params = array();
|
|
||||||
$params['inquiry_mode'] = 1;// 接诊方式:图文
|
|
||||||
$query->where($params)->whereIn('inquiry_type', [1, 3]);
|
|
||||||
if ($sort_order == 1) {
|
if ($sort_order == 1) {
|
||||||
// 综合-价格从低到高
|
// 综合-价格从低到高
|
||||||
$query->orderBy('inquiry_price', 'asc');
|
$query->orderBy('inquiry_price', 'asc');
|
||||||
@ -236,8 +231,6 @@ class UserDoctor extends Model
|
|||||||
// 价格从高到低
|
// 价格从高到低
|
||||||
$query->orderBy('inquiry_price', 'desc');
|
$query->orderBy('inquiry_price', 'desc');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $query;
|
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
->where($doctor_params)
|
->where($doctor_params)
|
||||||
@ -253,6 +246,14 @@ class UserDoctor extends Model
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
->whereHas('DoctorExpertise', function ($query) use ($doctor_expertise_params) {
|
||||||
|
$query->where($doctor_expertise_params);
|
||||||
|
})
|
||||||
|
->whereHas('DoctorInquiryConfig', function ($query) {
|
||||||
|
$params = array();
|
||||||
|
$params['inquiry_mode'] = 1;// 接诊方式:图文
|
||||||
|
$query->where($params)->whereIn('inquiry_type', [1, 3]);
|
||||||
|
})
|
||||||
->when($sort_order, function ($query, $sort_order) {
|
->when($sort_order, function ($query, $sort_order) {
|
||||||
if ($sort_order == 1) {
|
if ($sort_order == 1) {
|
||||||
$query->orderBy('is_recommend', 'desc');// 是否首页推荐(0:否 1:是)
|
$query->orderBy('is_recommend', 'desc');// 是否首页推荐(0:否 1:是)
|
||||||
@ -277,7 +278,12 @@ class UserDoctor extends Model
|
|||||||
$query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
$query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||||
}
|
}
|
||||||
return $query;
|
return $query;
|
||||||
});
|
})
|
||||||
|
// ->join('doctor_inquiry_config', 'user_doctor.doctor_id', '=', 'doctor_inquiry_config.doctor_id')
|
||||||
|
// ->groupBy("user_doctor.doctor_id")
|
||||||
|
// ->orderBy("doctor_inquiry_config.inquiry_price",'desc')
|
||||||
|
->select("user_doctor.*");
|
||||||
|
|
||||||
|
|
||||||
$result = $query->paginate($per_page, $fields, "page", $page);
|
$result = $query->paginate($per_page, $fields, "page", $page);
|
||||||
|
|
||||||
|
|||||||
@ -93,59 +93,59 @@ class PatientDoctorService extends BaseService
|
|||||||
$user_doctors = UserDoctor::getInquiryDoctorPage($keyword,$hospital_params, $doctor_params,$doctor_expertise_params, $sort_order, $fields,$page,$per_page);
|
$user_doctors = UserDoctor::getInquiryDoctorPage($keyword,$hospital_params, $doctor_params,$doctor_expertise_params, $sort_order, $fields,$page,$per_page);
|
||||||
|
|
||||||
// 处理数据
|
// 处理数据
|
||||||
if (!empty($user_doctors['data'])) {
|
// if (!empty($user_doctors['data'])) {
|
||||||
foreach ($user_doctors['data'] as &$user_doctor) {
|
// foreach ($user_doctors['data'] as &$user_doctor) {
|
||||||
$user_doctor['doctor_title_name'] = empty($user_doctor['doctor_title']) ? "" : DoctorTitleCode::getMessage($user_doctor['doctor_title']);
|
// $user_doctor['doctor_title_name'] = empty($user_doctor['doctor_title']) ? "" : DoctorTitleCode::getMessage($user_doctor['doctor_title']);
|
||||||
|
//
|
||||||
// 处理医生专长
|
// // 处理医生专长
|
||||||
if (!empty($user_doctor['DoctorExpertise'])) {
|
// if (!empty($user_doctor['DoctorExpertise'])) {
|
||||||
foreach ($user_doctor['DoctorExpertise'] as &$data) {
|
// foreach ($user_doctor['DoctorExpertise'] as &$data) {
|
||||||
if (!empty($data['DiseaseClassExpertise'])) {
|
// if (!empty($data['DiseaseClassExpertise'])) {
|
||||||
$data['expertise_name'] = $data['DiseaseClassExpertise']['expertise_name'];
|
// $data['expertise_name'] = $data['DiseaseClassExpertise']['expertise_name'];
|
||||||
}
|
// }
|
||||||
unset($data['DiseaseClassExpertise']);
|
// unset($data['DiseaseClassExpertise']);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// 处理问诊价格
|
// // 处理问诊价格
|
||||||
$user_doctor['price'] = 0;
|
// $user_doctor['price'] = 0;
|
||||||
$user_doctor['free_clinic_price'] = 0;
|
// $user_doctor['free_clinic_price'] = 0;
|
||||||
if (!empty($user_doctor['DoctorInquiryConfig'])) {
|
// if (!empty($user_doctor['DoctorInquiryConfig'])) {
|
||||||
foreach ($user_doctor['DoctorInquiryConfig'] as $doctor_inquiry_config) {
|
// foreach ($user_doctor['DoctorInquiryConfig'] as $doctor_inquiry_config) {
|
||||||
if ($doctor_inquiry_config['inquiry_mode'] == 1) {
|
// if ($doctor_inquiry_config['inquiry_mode'] == 1) {
|
||||||
if ($doctor_inquiry_config['inquiry_type'] == 1) {
|
// if ($doctor_inquiry_config['inquiry_type'] == 1) {
|
||||||
// 专家
|
// // 专家
|
||||||
$user_doctor['price'] = $doctor_inquiry_config['inquiry_price'] ?? 0;
|
// $user_doctor['price'] = $doctor_inquiry_config['inquiry_price'] ?? 0;
|
||||||
}
|
// }
|
||||||
if ($doctor_inquiry_config['inquiry_type'] == 3) {
|
// if ($doctor_inquiry_config['inquiry_type'] == 3) {
|
||||||
// 公益
|
// // 公益
|
||||||
$user_doctor['free_clinic_price'] = $doctor_inquiry_config['inquiry_price'];
|
// $user_doctor['free_clinic_price'] = $doctor_inquiry_config['inquiry_price'];
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
unset($user_doctor['DoctorInquiryConfig']);
|
// unset($user_doctor['DoctorInquiryConfig']);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// 好评率-超过5个已结束的订单后展示
|
// // 好评率-超过5个已结束的订单后展示
|
||||||
$user_doctor['praise_rate'] = floor($user_doctor['praise_rate'] * 0.05 * 100) / 100;
|
// $user_doctor['praise_rate'] = floor($user_doctor['praise_rate'] * 0.05 * 100) / 100;
|
||||||
// 响应时间-超过5个已结束的订单后展示
|
// // 响应时间-超过5个已结束的订单后展示
|
||||||
$user_doctor['avg_response_time'] = (float)floor($user_doctor['avg_response_time'] * 10) / 10;
|
// $user_doctor['avg_response_time'] = (float)floor($user_doctor['avg_response_time'] * 10) / 10;
|
||||||
|
//
|
||||||
// 获取医生订单数
|
// // 获取医生订单数
|
||||||
$params = array();
|
// $params = array();
|
||||||
$params['doctor_id'] = $user_doctor['doctor_id'];
|
// $params['doctor_id'] = $user_doctor['doctor_id'];
|
||||||
$params['inquiry_status'] = 6; // 已结束
|
// $params['inquiry_status'] = 6; // 已结束
|
||||||
$inquiry_order_count = OrderInquiry::getCount($params);
|
// $inquiry_order_count = OrderInquiry::getCount($params);
|
||||||
if (empty($inquiry_order_count) || $inquiry_order_count == 0) {
|
// if (empty($inquiry_order_count) || $inquiry_order_count == 0) {
|
||||||
$user_doctor['is_display_score'] = false;
|
// $user_doctor['is_display_score'] = false;
|
||||||
} else {
|
// } else {
|
||||||
$user_doctor['is_display_score'] = true;
|
// $user_doctor['is_display_score'] = true;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// 头像
|
// // 头像
|
||||||
$user_doctor['avatar'] = addAliyunOssWebsite($user_doctor['avatar']);
|
// $user_doctor['avatar'] = addAliyunOssWebsite($user_doctor['avatar']);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return success($user_doctors);
|
return success($user_doctors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class Base
|
|||||||
* @return array
|
* @return array
|
||||||
* @throws GuzzleException
|
* @throws GuzzleException
|
||||||
*/
|
*/
|
||||||
protected function httpRequest(string $sign,array $arg = []): array
|
protected function httpRequest(string $sign,$path,array $arg = []): array
|
||||||
{
|
{
|
||||||
$option = [
|
$option = [
|
||||||
"headers" => [
|
"headers" => [
|
||||||
@ -78,7 +78,7 @@ class Base
|
|||||||
$arg = array_merge($arg,$option);
|
$arg = array_merge($arg,$option);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = $this->client->post($this->request_url, $arg);
|
$response = $this->client->post($path, $arg);
|
||||||
|
|
||||||
if ($response->getStatusCode() != '200'){
|
if ($response->getStatusCode() != '200'){
|
||||||
// 请求失败
|
// 请求失败
|
||||||
|
|||||||
@ -123,6 +123,14 @@ class Wy extends Base
|
|||||||
// 获取签名
|
// 获取签名
|
||||||
$sign = $this->getSign();
|
$sign = $this->getSign();
|
||||||
|
|
||||||
|
// 获取回调地址
|
||||||
|
$app_env = \Hyperf\Config\config("app_env",'dev');
|
||||||
|
if ($app_env == "prod"){
|
||||||
|
$callback_url = env('DOMAIN_NAME_PROD','https://prod.hospital.applets.igandanyiyuan.com/');
|
||||||
|
}else{
|
||||||
|
$callback_url = env('DOMAIN_NAME_DEV','https://dev.hospital.applets.igandanyiyuan.com/');
|
||||||
|
}
|
||||||
|
|
||||||
$arg = array();
|
$arg = array();
|
||||||
$arg['appId'] = $this->app_id;
|
$arg['appId'] = $this->app_id;
|
||||||
$arg['orderCode'] = $order_detection['detection_no']; // 订单编号
|
$arg['orderCode'] = $order_detection['detection_no']; // 订单编号
|
||||||
@ -143,14 +151,15 @@ class Wy extends Base
|
|||||||
$arg['projectPurpose'] = $detection_project_purpose['purpose_name']; // 检测项目用途名称
|
$arg['projectPurpose'] = $detection_project_purpose['purpose_name']; // 检测项目用途名称
|
||||||
$arg['payTime'] = $order_detection['pay_time']; // 支付时间
|
$arg['payTime'] = $order_detection['pay_time']; // 支付时间
|
||||||
$arg['payAmount'] = $order_detection['payment_amount_total']; // 支付金额
|
$arg['payAmount'] = $order_detection['payment_amount_total']; // 支付金额
|
||||||
$arg['reportUrl'] = $this->request_url; // 推送报告的回调地址
|
$arg['reportUrl'] = $callback_url . "callback/detection"; // 推送报告的回调地址
|
||||||
|
|
||||||
$option = [
|
$option = [
|
||||||
"json" => $arg
|
"json" => $arg
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$path = $this->request_url . "api/sdInternet/v1/externalData/saveOrder";
|
||||||
try {
|
try {
|
||||||
$response = $this->httpRequest($sign,$option);
|
$response = $this->httpRequest($sign,$path,$option);
|
||||||
if (empty($response)){
|
if (empty($response)){
|
||||||
// 返回值错误为空
|
// 返回值错误为空
|
||||||
throw new BusinessException("");
|
throw new BusinessException("");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user