66 lines
1.8 KiB
PHP
66 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use App\Constants\HttpEnumCode;
|
|
use App\Model\OrderProduct;
|
|
use App\Model\PatientPathography;
|
|
|
|
/**
|
|
* 家庭成员病情记录
|
|
*/
|
|
class PatientPathographyService extends BaseService
|
|
{
|
|
/**
|
|
* 检测家庭成员是否存在病情记录
|
|
* @return array
|
|
*/
|
|
public function existFamilyPathography(): array
|
|
{
|
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
|
$family_id = $this->request->input('family_id');
|
|
|
|
$result = array();
|
|
$result['is_exist'] = 0;
|
|
|
|
// 获取病情记录
|
|
$params = array();
|
|
$params['user_id'] = $user_info['user_id'];
|
|
$params['patient_id'] = $user_info['client_user_id'];
|
|
$params['family_id'] = $family_id;
|
|
$patient_pathography = PatientPathography::getLastOne($params);
|
|
if (!empty($patient_pathography)){
|
|
$result['is_exist'] = 1;
|
|
}
|
|
|
|
return success($result);
|
|
}
|
|
|
|
/**
|
|
* 获取家庭成员病情记录列表-分页
|
|
* @return array
|
|
*/
|
|
public function getFamilyPathographyList(): array
|
|
{
|
|
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
|
$family_id = $this->request->input('family_id');
|
|
$page = $this->request->input('page', 1);
|
|
$per_page = $this->request->input('per_page', 10);
|
|
|
|
// 获取病情记录列表
|
|
$fields = [
|
|
"pathography_id",
|
|
"created_at",
|
|
"disease_class_name",
|
|
"disease_desc"
|
|
];
|
|
|
|
$params = array();
|
|
$params['user_id'] = $user_info['user_id'];
|
|
$params['patient_id'] = $user_info['client_user_id'];
|
|
$params['family_id'] = $family_id;
|
|
$patient_pathographys = PatientPathography::getPatientPathographyPage($params, $fields, $page, $per_page);
|
|
|
|
return success($patient_pathographys);
|
|
}
|
|
} |