1
This commit is contained in:
parent
806a9e02c5
commit
426988d8d3
@ -43,4 +43,15 @@ class MessageNoticeController extends AbstractController
|
||||
$data = $MessageNoticeService->getDoctorMessageSystemInfo();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息已读
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function putMessageReadId(): ResponseInterface
|
||||
{
|
||||
$MessageNoticeService = new MessageNoticeService();
|
||||
$data = $MessageNoticeService->putMessageReadId();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
}
|
||||
@ -110,4 +110,15 @@ class MessageNotice extends Model
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
* @param array $params
|
||||
* @param array $data
|
||||
* @return int
|
||||
*/
|
||||
public static function edit(array $params = [], array $data = []): int
|
||||
{
|
||||
return self::where($params)->update($data);
|
||||
}
|
||||
}
|
||||
|
||||
@ -185,6 +185,7 @@ class DoctorInquiryService extends BaseService
|
||||
if ($inquiry_type == 1) {
|
||||
// 专家
|
||||
$data['is_img_expert_reception'] = $is_open;
|
||||
$data['is_online'] = $is_open;
|
||||
} elseif ($inquiry_type == 2) {
|
||||
// 快速
|
||||
$data['is_img_quick_reception'] = $is_open;
|
||||
|
||||
@ -647,7 +647,7 @@ class InquiryService extends BaseService
|
||||
$result['duration'] = $duration;
|
||||
$result['follow'] = $follow;
|
||||
$result['is_evaluation'] = $is_evaluation;
|
||||
$result['reception_time'] = $order_inquiry['reception_time'] ?? ""; // 接诊时间
|
||||
$result['reception_time'] = $order_inquiry['reception_time'] ?: null; // 接诊时间
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
@ -132,4 +132,32 @@ class MessageNoticeService extends BaseService
|
||||
|
||||
return success($message_notice->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息已读
|
||||
* @return array
|
||||
*/
|
||||
public function putMessageReadId(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$notice_id = $this->request->route('notice_id');
|
||||
|
||||
$params = array();
|
||||
$params['notice_id'] = $notice_id;
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$message_notice = MessageNotice::getExists($params);
|
||||
if (empty($message_notice)){
|
||||
return success();
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['read_status'] = 1;
|
||||
|
||||
$params = array();
|
||||
$params['notice_id'] = $notice_id;
|
||||
MessageNotice::edit($params,$data);
|
||||
|
||||
return success();
|
||||
}
|
||||
}
|
||||
@ -413,10 +413,6 @@ class PatientDoctorService extends BaseService
|
||||
return fail();
|
||||
}
|
||||
|
||||
if ($user_doctor['is_img_expert_reception'] != 1) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "医生未开通在线问诊服务");
|
||||
}
|
||||
|
||||
// 检测当前医生是否和患者存在未完成问诊订单
|
||||
$InquiryService = new InquiryService();
|
||||
$order_inquiry = $InquiryService->checkPatientDoctorProgressInquiry($user_info['client_user_id'],$doctor_id);
|
||||
|
||||
@ -590,10 +590,10 @@ Router::addGroup('/address', function () {
|
||||
// 消息通知
|
||||
Router::addGroup('/message', function () {
|
||||
// 消息已读
|
||||
Router::post('/read/{notice_id:\d+}', [UserDoctorController::class, 'getDoctorCenter']);
|
||||
Router::put('/read/{notice_id:\d+}', [MessageNoticeController::class, 'putMessageReadId']);
|
||||
|
||||
// 一键消息已读
|
||||
Router::get('/read', [UserDoctorController::class, 'getDoctorCenterInfo']);
|
||||
Router::get('/read', [MessageNoticeController::class, 'putMessageRead']);
|
||||
});
|
||||
|
||||
// 问诊订单
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user