@@ -252,8 +252,7 @@ class BasicDataService extends BaseService
|
|||||||
if (isset($pharmacy_id) && $pharmacy_id !== '') {
|
if (isset($pharmacy_id) && $pharmacy_id !== '') {
|
||||||
$pharmacy = Pharmacy::getValidPharmacy($pharmacy_id);
|
$pharmacy = Pharmacy::getValidPharmacy($pharmacy_id);
|
||||||
} else {
|
} else {
|
||||||
$defaultPharmacy = DoctorPharmacy::getDoctorDefaultPharmacy($doctor_id);
|
$pharmacy = DoctorPharmacy::getDoctorDefaultPharmacy($doctor_id);
|
||||||
$pharmacy = ($defaultPharmacy && $defaultPharmacy->Pharmacy && $defaultPharmacy->Pharmacy->status == 1) ? $defaultPharmacy->Pharmacy : null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($pharmacy) || empty($pharmacy->pharmacy_code)) {
|
if (empty($pharmacy) || empty($pharmacy->pharmacy_code)) {
|
||||||
@@ -477,8 +476,7 @@ class BasicDataService extends BaseService
|
|||||||
if (isset($pharmacy_id) && $pharmacy_id !== '') {
|
if (isset($pharmacy_id) && $pharmacy_id !== '') {
|
||||||
$pharmacy = Pharmacy::getValidPharmacy($pharmacy_id);
|
$pharmacy = Pharmacy::getValidPharmacy($pharmacy_id);
|
||||||
} else {
|
} else {
|
||||||
$defaultPharmacy = DoctorPharmacy::getDoctorDefaultPharmacy($doctor_id);
|
$pharmacy = DoctorPharmacy::getDoctorDefaultPharmacy($doctor_id);
|
||||||
$pharmacy = ($defaultPharmacy && $defaultPharmacy->Pharmacy && $defaultPharmacy->Pharmacy->status == 1) ? $defaultPharmacy->Pharmacy : null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($pharmacy) || empty($pharmacy->pharmacy_code)) {
|
if (empty($pharmacy) || empty($pharmacy->pharmacy_code)) {
|
||||||
|
|||||||
@@ -1204,16 +1204,16 @@ class UserDoctorService extends BaseService
|
|||||||
// 校验医生是否已配置有效的默认药房
|
// 校验医生是否已配置有效的默认药房
|
||||||
$doctor_id = $user_info['client_user_id'] ?? 0;
|
$doctor_id = $user_info['client_user_id'] ?? 0;
|
||||||
$default_pharmacy = DoctorPharmacy::getDoctorDefaultPharmacy($doctor_id);
|
$default_pharmacy = DoctorPharmacy::getDoctorDefaultPharmacy($doctor_id);
|
||||||
if (empty($default_pharmacy) || empty($default_pharmacy->Pharmacy) || $default_pharmacy->Pharmacy->status != 1 || empty($default_pharmacy->Pharmacy->pharmacy_code)) {
|
if (empty($default_pharmacy)) {
|
||||||
$result['status'] = 2;
|
$result['status'] = 2;
|
||||||
$result['message'] = "您尚未配置默认药房或药房已停用,请前往【我的-药房设置】完成绑定后再开具处方";
|
$result['message'] = "您尚未配置默认药房或药房已停用,请联系客服人员完成绑定后再开具处方";
|
||||||
return success($result);
|
return success($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result['data']['default_pharmacy'] = [
|
$result['data']['default_pharmacy'] = [
|
||||||
'pharmacy_id' => (string)$default_pharmacy->Pharmacy->pharmacy_id,
|
'pharmacy_id' => (string)$default_pharmacy->pharmacy_id,
|
||||||
'pharmacy_code' => $default_pharmacy->Pharmacy->pharmacy_code,
|
'pharmacy_code' => $default_pharmacy->pharmacy_code,
|
||||||
'pharmacy_name' => $default_pharmacy->Pharmacy->pharmacy_name,
|
'pharmacy_name' => $default_pharmacy->pharmacy_name,
|
||||||
];
|
];
|
||||||
|
|
||||||
$params = array();
|
$params = array();
|
||||||
@@ -1486,10 +1486,7 @@ class UserDoctorService extends BaseService
|
|||||||
if (isset($input_pharmacy_id) && $input_pharmacy_id !== '') {
|
if (isset($input_pharmacy_id) && $input_pharmacy_id !== '') {
|
||||||
$pharmacy = Pharmacy::getValidPharmacy($input_pharmacy_id);
|
$pharmacy = Pharmacy::getValidPharmacy($input_pharmacy_id);
|
||||||
} else {
|
} else {
|
||||||
$doctor_default = DoctorPharmacy::getDoctorDefaultPharmacy($user_info['client_user_id'] ?? 0);
|
$pharmacy = DoctorPharmacy::getDoctorDefaultPharmacy($user_info['client_user_id'] ?? 0);
|
||||||
if ($doctor_default && $doctor_default->Pharmacy && $doctor_default->Pharmacy->status == 1) {
|
|
||||||
$pharmacy = $doctor_default->Pharmacy;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($pharmacy) || empty($pharmacy['pharmacy_code'])) {
|
if (empty($pharmacy) || empty($pharmacy['pharmacy_code'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user