增加是否可处方
This commit is contained in:
parent
fe86a1834f
commit
2ee8f81956
@ -18,13 +18,13 @@ class DoctorInquiryConfigController extends AbstractController
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getInquiryConfig(): ResponseInterface
|
||||
public function getDoctorInquiryConfig(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(DoctorInquiryConfigRequest::class);
|
||||
$request->scene('getInquiryConfig')->validateResolved();
|
||||
$request->scene('getDoctorInquiryConfig')->validateResolved();
|
||||
|
||||
$DoctorInquiryService = new DoctorInquiryService();
|
||||
$data = $DoctorInquiryService->getInquiryConfig();
|
||||
$data = $DoctorInquiryService->getDoctorInquiryConfig();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
@ -34,13 +34,13 @@ class DoctorInquiryConfigController extends AbstractController
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function putInquiryOpen(): ResponseInterface
|
||||
public function putDoctorInquiryOpen(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(DoctorInquiryConfigRequest::class);
|
||||
$request->scene('putInquiryOpen')->validateResolved();
|
||||
$request->scene('putDoctorInquiryOpen')->validateResolved();
|
||||
|
||||
$DoctorInquiryService = new DoctorInquiryService();
|
||||
$data = $DoctorInquiryService->putInquiryOpen();
|
||||
$data = $DoctorInquiryService->putDoctorInquiryOpen();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
@ -50,13 +50,13 @@ class DoctorInquiryConfigController extends AbstractController
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function putInquiryConfig(): ResponseInterface
|
||||
public function putDoctorInquiryConfig(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(DoctorInquiryConfigRequest::class);
|
||||
$request->scene('putInquiryConfig')->validateResolved();
|
||||
$request->scene('putDoctorInquiryConfig')->validateResolved();
|
||||
|
||||
$DoctorInquiryService = new DoctorInquiryService();
|
||||
$data = $DoctorInquiryService->putInquiryConfig();
|
||||
$data = $DoctorInquiryService->putDoctorInquiryConfig();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
|
||||
@ -11,16 +11,16 @@ use Hyperf\Validation\Rule;
|
||||
class DoctorInquiryConfigRequest extends FormRequest
|
||||
{
|
||||
protected array $scenes = [
|
||||
'getInquiryConfig' => [ // 获取医生问诊配置
|
||||
'getDoctorInquiryConfig' => [ // 获取医生问诊配置
|
||||
'inquiry_type',
|
||||
'inquiry_mode',
|
||||
],
|
||||
'putInquiryOpen' => [ // 医生问诊开关
|
||||
'putDoctorInquiryOpen' => [ // 医生问诊开关
|
||||
'inquiry_type',
|
||||
'inquiry_mode',
|
||||
'is_open',
|
||||
],
|
||||
'putInquiryConfig' => [ // 修改医生问诊配置
|
||||
'putDoctorInquiryConfig' => [ // 修改医生问诊配置
|
||||
'inquiry_type',
|
||||
'inquiry_mode',
|
||||
'inquiry_price',
|
||||
|
||||
@ -20,7 +20,7 @@ class DoctorInquiryService extends BaseService
|
||||
* 获取医生问诊配置
|
||||
* @return array
|
||||
*/
|
||||
public function getInquiryConfig(): array
|
||||
public function getDoctorInquiryConfig(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
@ -138,7 +138,7 @@ class DoctorInquiryService extends BaseService
|
||||
* 医生问诊开关
|
||||
* @return array
|
||||
*/
|
||||
public function putInquiryOpen(): array
|
||||
public function putDoctorInquiryOpen(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
@ -226,7 +226,7 @@ class DoctorInquiryService extends BaseService
|
||||
* 修改医生问诊配置
|
||||
* @return array
|
||||
*/
|
||||
public function putInquiryConfig(): array
|
||||
public function putDoctorInquiryConfig(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
|
||||
@ -1051,6 +1051,8 @@ class InquiryService extends BaseService
|
||||
/**
|
||||
* 结束问诊
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function putFinishInquiry(): array
|
||||
{
|
||||
@ -1664,7 +1666,7 @@ class InquiryService extends BaseService
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function inquiryRefund(string $order_inquiry_id, string $refund_reason)
|
||||
public function inquiryRefund(string $order_inquiry_id, string $refund_reason): void
|
||||
{
|
||||
// 获取订单数据
|
||||
$params = array();
|
||||
|
||||
@ -110,17 +110,8 @@ class PatientDoctorService extends BaseService
|
||||
}
|
||||
|
||||
// 处理可处方字段
|
||||
$user_doctor['multi_point_enable'] = 0;
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor["doctor_id"];
|
||||
$params['inquiry_type'] = 4;
|
||||
$params['inquiry_mode'] = 1;
|
||||
$params['is_enable'] = 1;
|
||||
$result = DoctorInquiryConfig::getOne($params);
|
||||
if (!empty($result)){
|
||||
$user_doctor['multi_point_enable'] = 1;
|
||||
}
|
||||
$userDoctorService = new UserDoctorService();
|
||||
$user_doctor['multi_point_enable'] = $userDoctorService->getDoctorMultiPointEnable($user_doctor["doctor_id"]);
|
||||
|
||||
// 好评率-超过5个已结束的订单后展示
|
||||
$user_doctor['praise_rate'] = floor($user_doctor['praise_rate'] * 0.05 * 100) / 100;
|
||||
@ -453,6 +444,7 @@ class PatientDoctorService extends BaseService
|
||||
return success();
|
||||
}
|
||||
|
||||
$userDoctorService = new UserDoctorService();
|
||||
foreach ($recommend_doctors as $recommend_doctor) {
|
||||
$data = array();
|
||||
$data['doctor_id'] = $recommend_doctor['doctor_id'];
|
||||
@ -472,12 +464,9 @@ class PatientDoctorService extends BaseService
|
||||
$data['is_online'] = $recommend_doctor['user']['is_online'];
|
||||
}
|
||||
|
||||
// 是否开启问诊购药
|
||||
foreach ($recommend_doctor['DoctorInquiryConfig'] as $doctor_inquiry_config) {
|
||||
if ($doctor_inquiry_config['inquiry_mode'] == 1){
|
||||
if ($doctor_inquiry_config['inquiry_type'] == 4 && $doctor_inquiry_config['is_enable'] == 1) {
|
||||
$data['multi_point_enable'] = 1; // 是否开启问诊购药
|
||||
}
|
||||
}
|
||||
$data['multi_point_enable'] = $userDoctorService->getDoctorMultiPointEnable("",$doctor_inquiry_config);
|
||||
}
|
||||
|
||||
$data['doctor_inquiry_config'] = $recommend_doctor['DoctorInquiryConfig'];
|
||||
|
||||
@ -2216,6 +2216,10 @@ class UserDoctorService extends BaseService
|
||||
$result['is_online'] = $user['is_online'];
|
||||
}
|
||||
|
||||
// 处理可处方字段
|
||||
$userDoctorService = new UserDoctorService();
|
||||
$result['multi_point_enable'] = $userDoctorService->getDoctorMultiPointEnable($doctor_id);
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
@ -2295,8 +2299,8 @@ class UserDoctorService extends BaseService
|
||||
return fail();
|
||||
}
|
||||
|
||||
$value['times_number'] = $doctor_inquiry_config_service['service_period']; // 服务回合数(0表示不限次)
|
||||
$value['duration'] = $doctor_inquiry_config_service['duration']; // 服务周期(天,不存在0的情况)
|
||||
$value['times_number'] = $doctor_inquiry_config_service['service_rounds']; // 服务回合数(0表示不限次)
|
||||
$value['duration'] = $doctor_inquiry_config_service['service_period']; // 服务周期(天,不存在0的情况)
|
||||
$value['service_content'] = $doctor_inquiry_config_service['service_content'];// 服务内容
|
||||
$value['service_process'] = $doctor_inquiry_config_service['service_process'];// 服务流程
|
||||
|
||||
@ -2711,4 +2715,35 @@ class UserDoctorService extends BaseService
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取医生是否可处方图标展示状态
|
||||
* @param string $doctor_id 医生id
|
||||
* @param array|object|null $doctor_inquiry_config 医生问诊配置
|
||||
* @return int
|
||||
*/
|
||||
public function getDoctorMultiPointEnable(string $doctor_id = "",array|object $doctor_inquiry_config = null): int
|
||||
{
|
||||
$multi_point_enable = 0; // 是否开启问诊购药
|
||||
if (!empty($doctor_inquiry_config)){
|
||||
if ($doctor_inquiry_config['inquiry_type'] == 4 && $doctor_inquiry_config['inquiry_mode'] == 1 && $doctor_inquiry_config['is_enable'] == 1){
|
||||
$multi_point_enable = 1;
|
||||
}
|
||||
} else {
|
||||
if (empty($doctor_id)){
|
||||
return $multi_point_enable;
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['inquiry_type'] = 4;
|
||||
$params['inquiry_mode'] = 1;
|
||||
$params['is_enable'] = 1;
|
||||
$result = DoctorInquiryConfig::getOne($params);
|
||||
if (!empty($result)){
|
||||
$multi_point_enable = 1; // 是否开启问诊购药
|
||||
}
|
||||
}
|
||||
|
||||
return $multi_point_enable;
|
||||
}
|
||||
}
|
||||
@ -101,13 +101,13 @@ Router::addGroup('/doctor', function () {
|
||||
// 问诊配置
|
||||
Router::addGroup('/config', function () {
|
||||
// 获取医生问诊配置
|
||||
Router::get('', [DoctorInquiryConfigController::class, 'getInquiryConfig']);
|
||||
Router::get('', [DoctorInquiryConfigController::class, 'getDoctorInquiryConfig']);
|
||||
|
||||
// 修改医生问诊配置
|
||||
Router::put('', [DoctorInquiryConfigController::class, 'putInquiryConfig']);
|
||||
Router::put('', [DoctorInquiryConfigController::class, 'putDoctorInquiryConfig']);
|
||||
|
||||
// 医生问诊开关
|
||||
Router::put('/open', [DoctorInquiryConfigController::class, 'putInquiryOpen']);
|
||||
Router::put('/open', [DoctorInquiryConfigController::class, 'putDoctorInquiryOpen']);
|
||||
|
||||
// 获取医生问诊配置-疑难会诊-服务设置
|
||||
Router::get('/service', [DoctorInquiryConfigController::class, 'getInquiryServiceConfig']);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user