修正获取患者问诊病例
This commit is contained in:
@@ -20,6 +20,7 @@ use App\Model\PatientFamilyHealth;
|
||||
use App\Model\PatientFamilyPersonal;
|
||||
use App\Model\Product;
|
||||
use App\Model\SystemInquiryConfig;
|
||||
use App\Model\User;
|
||||
use App\Model\UserCoupon;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserPatient;
|
||||
@@ -284,10 +285,22 @@ class InquiryService extends BaseService
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
$order_inquiry_id = $this->request->input('order_inquiry_id');
|
||||
|
||||
// 获取用户数据
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user = User::getOne($params);
|
||||
if (empty($user)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 获取订单数据
|
||||
$params = array();
|
||||
$params['order_inquiry_id'] = $order_inquiry_id;
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
if ($user['user_type'] == 1){
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
}elseif ($user['user_type'] == 2){
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
}
|
||||
$order_inquiry = OrderInquiry::getOne($params);
|
||||
if (empty($order_inquiry)) {
|
||||
return fail();
|
||||
@@ -306,6 +319,7 @@ class InquiryService extends BaseService
|
||||
$params = array();
|
||||
$params['family_id'] = $order_inquiry_case['family_id'];
|
||||
$patient_family = PatientFamily::getOne($params);
|
||||
|
||||
$order_inquiry_case['height'] = $order_inquiry_case['height'] ?: $patient_family['height'] ?: NULL;
|
||||
$order_inquiry_case['weight'] = $order_inquiry_case['weight'] ?: $patient_family['weight'] ?: NULL;
|
||||
$order_inquiry_case['job_name'] = $patient_family['job_name'] ?? "";
|
||||
@@ -323,6 +337,7 @@ class InquiryService extends BaseService
|
||||
$params = array();
|
||||
$params['family_id'] = $order_inquiry_case['family_id'];
|
||||
$patient_family_personal = PatientFamilyPersonal::getOne($params);
|
||||
|
||||
$order_inquiry_case['drink_wine_status'] = $patient_family_personal['drink_wine_status'] ?? 1;
|
||||
$order_inquiry_case['smoke_status'] = $patient_family_personal['smoke_status'] ?? 1;
|
||||
$order_inquiry_case['chemical_compound_status'] = $patient_family_personal['chemical_compound_status'] ?? 1;
|
||||
|
||||
Reference in New Issue
Block a user