暂时去除短信发送
This commit is contained in:
parent
5825138b7f
commit
a169d82377
@ -44,7 +44,7 @@ class CodeService extends BaseService
|
||||
$template_param['code'] = mt_rand(1,9) . (int)substr($generator->generate(),-3);
|
||||
|
||||
// 发送短信
|
||||
Dysms::sendSms($phone,$template_param,$template_code,1);
|
||||
// Dysms::sendSms($phone,$template_param,$template_code,1);
|
||||
|
||||
if (empty($result)){
|
||||
$redis_value = 1;
|
||||
|
||||
@ -11,6 +11,7 @@ use App\Model\PatientFamily;
|
||||
use App\Model\Product;
|
||||
use App\Model\SystemInquiryConfig;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Utils\PcreMatch;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Snowflake\IdGeneratorInterface;
|
||||
|
||||
@ -109,15 +110,10 @@ class OrderInquiryService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"患者信息错误");
|
||||
}
|
||||
|
||||
// 检测当前家庭成员是否和医生有未完成订单
|
||||
$params = array();
|
||||
$params[] = ['patient_id','=',$user_info['client_user_id']];
|
||||
$params[] = ['family_id','=',$request_params['family_id']];
|
||||
$params[] = ['inquiry_mode','=',1];
|
||||
$params[] = ['inquiry_status','in',[1,2,3,4]]; // 1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消
|
||||
$params[] = ['inquiry_refund_status','=',0];
|
||||
$order_inquiry_count = OrderInquiry::getCount($params);
|
||||
if ($order_inquiry_count != 0){
|
||||
// 检测当前家庭成员是否存在未完成的问诊订单
|
||||
$UserPatientService = new UserPatientService();
|
||||
$res = $UserPatientService->getNotFinishedOrdeInquiry($user_info['client_user_id']);
|
||||
if (!empty($res)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"当前患者存在进行中的问诊订单");
|
||||
}
|
||||
|
||||
@ -222,6 +218,16 @@ class OrderInquiryService extends BaseService
|
||||
return fail(HttpEnumCode::SERVER_ERROR,"订单创建失败");
|
||||
}
|
||||
|
||||
|
||||
// 处理复诊凭证
|
||||
if (!empty($request_params['diagnose_images'])){
|
||||
// 医师资格证
|
||||
$diagnose_images = implode(',', $request_params['diagnose_images']);
|
||||
$diagnose_images = PcreMatch::pregRemoveOssWebsite($diagnose_images);
|
||||
}
|
||||
|
||||
dump($patient_family->toArray());
|
||||
dump($patient_family['card_name']);
|
||||
// 增加患者问诊病例
|
||||
$data = array();
|
||||
$data['user_id'] = $user_info['user_id'];
|
||||
@ -233,18 +239,21 @@ class OrderInquiryService extends BaseService
|
||||
|
||||
$data['sex'] = $patient_family['sex'] ?? 0; // 患者性别(0:未知 1:男 2:女)
|
||||
$data['age'] = $patient_family['age'] ?? null; // 患者年龄
|
||||
$data['height'] = $request_params['height'] ?: $patient_family['height'] ?: null; // 身高(cm)
|
||||
$data['weight'] = $request_params['weight'] ?: $patient_family['weight'] ?: null;; // 体重(kg)
|
||||
$data['height'] = $request_params['height'] ?? $patient_family['height'] ?: null; // 身高(cm)
|
||||
$data['weight'] = $request_params['weight'] ?? $patient_family['weight'] ?: null;; // 体重(kg)
|
||||
|
||||
$data['disease_class_id'] = $disease_class['disease_class_id']; // 疾病分类id-系统
|
||||
$data['disease_class_name'] = $patient_family['card_name']; // 疾病名称-系统
|
||||
$data['diagnosis_date'] = $patient_family['card_name']; // 确诊日期
|
||||
$data['disease_desc'] = $patient_family['card_name']; // 病情描述(主诉)
|
||||
$data['diagnose_images'] = $patient_family['card_name']; // 复诊凭证(多个使用逗号分隔)
|
||||
$data['is_allergy_history'] = $patient_family['card_name']; // 是否存在过敏史(0:否 1:是)
|
||||
$data['allergy_history'] = $patient_family['card_name']; // 过敏史描述
|
||||
$data['is_family_history'] = $patient_family['card_name']; // 是否存在家族病史(0:否 1:是)
|
||||
$data['family_history'] = $patient_family['card_name']; // 家族病史描述
|
||||
$data['disease_class_name'] = $disease_class['disease_class_name']; // 疾病名称-系统
|
||||
$data['diagnosis_date'] = $request_params['diagnosis_date'] ?: null; // 确诊日期
|
||||
$data['disease_desc'] = $request_params['disease_desc'] ?: null; // 病情描述(主诉)
|
||||
$data['diagnose_images'] = $diagnose_images ?? ""; // 复诊凭证(多个使用逗号分隔)
|
||||
$data['is_allergy_history'] = $request_params['is_allergy_history'] ?: 0; // 是否存在过敏史(0:否 1:是)
|
||||
$data['allergy_history'] = $request_params['allergy_history'] ?? null; // 过敏史描述
|
||||
$data['is_family_history'] = $request_params['is_family_history'] ?: 0; // 是否存在家族病史(0:否 1:是)
|
||||
$data['family_history'] = $request_params['family_history'] ?? null; // 家族病史描述
|
||||
$data['is_pregnant'] = $request_params['is_pregnant'] ?: 0; // 是否备孕、妊娠、哺乳期(0:否 1:是)
|
||||
|
||||
dump($data);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
|
||||
@ -35,36 +35,50 @@ class PatientCaseService extends BaseService
|
||||
$params['status'] = 1;
|
||||
$order_inquiry_case = OrderInquiryCase::getEndOrderInquiryCaseOne($params,$order_inquiry_params);
|
||||
|
||||
if (!empty($order_inquiry_case)){
|
||||
if (!empty($order_inquiry_case['OrderInquiry'])){
|
||||
if ($order_inquiry_case['OrderInquiry']['inquiry_type'] == 4){
|
||||
if (empty($order_inquiry_case)){
|
||||
return success();
|
||||
}
|
||||
|
||||
$order_inquiry_case = $order_inquiry_case->toArray();
|
||||
|
||||
if (!empty($order_inquiry_case['order_inquiry'])){
|
||||
if ($order_inquiry_case['order_inquiry']['inquiry_type'] == 4){
|
||||
// 问诊购药存在用药意向
|
||||
$params = array();
|
||||
$params['inquiry_case_id'] = $order_inquiry_case['inquiry_case_id'];
|
||||
$inquiry_case_product = InquiryCaseProduct::getWithProductList($params);
|
||||
if (!empty($inquiry_case_product)){
|
||||
foreach ($inquiry_case_product as &$item){
|
||||
if (!empty($item['Product'])){
|
||||
$item['product_name'] = $item['Product']['product_name'];
|
||||
$item['product_price'] = $item['Product']['product_price'];
|
||||
$item['product_type'] = $item['Product']['product_type'];
|
||||
$item['product_cover_img'] = $item['Product']['product_cover_img'];
|
||||
$item['product_spec'] = $item['Product']['product_spec'];
|
||||
$item['license_number'] = $item['Product']['license_number'];
|
||||
$item['manufacturer'] = $item['Product']['manufacturer'];
|
||||
$item['packaging_unit'] = $item['Product']['packaging_unit'];
|
||||
if (!empty($item['product'])){
|
||||
$item['product_name'] = $item['product']['product_name'];
|
||||
$item['product_price'] = $item['product']['product_price'];
|
||||
$item['product_type'] = $item['product']['product_type'];
|
||||
$item['product_cover_img'] = addAliyunOssWebsite($item['product']['product_cover_img']);
|
||||
$item['product_spec'] = $item['product']['product_spec'];
|
||||
$item['license_number'] = $item['product']['license_number'];
|
||||
$item['manufacturer'] = $item['product']['manufacturer'];
|
||||
$item['packaging_unit'] = $item['product']['packaging_unit'];
|
||||
|
||||
unset($item['Product']);
|
||||
unset($item['product']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($order_inquiry_case['OrderInquiry']);
|
||||
}
|
||||
unset($order_inquiry_case['order_inquiry']);
|
||||
}
|
||||
|
||||
$order_inquiry_case['Product'] = $inquiry_case_product ?? [];
|
||||
// 复诊凭证
|
||||
if (!empty($order_inquiry_case['diagnose_images'])){
|
||||
$diagnose_images = explode(',',$order_inquiry_case['diagnose_images']);
|
||||
foreach ($diagnose_images as &$item){
|
||||
$item = addAliyunOssWebsite($item);
|
||||
}
|
||||
|
||||
return empty($order_inquiry_case) ? success() : success($order_inquiry_case->toArray());
|
||||
$order_inquiry_case['diagnose_images'] = $diagnose_images;
|
||||
}
|
||||
|
||||
$order_inquiry_case['product'] = $inquiry_case_product ?? [];
|
||||
|
||||
return success($order_inquiry_case);
|
||||
}
|
||||
}
|
||||
@ -342,16 +342,10 @@ class PatientDoctorService extends BaseService
|
||||
$doctor_id = $this->request->input('doctor_id','');
|
||||
|
||||
// 检测是否存在未完成的问诊订单
|
||||
$params = array();
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
$params['inquiry_type'] = $inquiry_type;
|
||||
$params['inquiry_mode'] = $inquiry_mode;
|
||||
$order_inquiry = OrderInquiry::getOne($params);
|
||||
if (!empty($order_inquiry)) {
|
||||
// 1:待支付 2:待分配 3:待接诊 4:已接诊
|
||||
if (in_array($order_inquiry['inquiry_status'], [1, 2, 3, 4])) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"当前有未完成服务,不允许再次购买",[$order_inquiry['order_inquiry_id']]);
|
||||
}
|
||||
$UserPatientService = new UserPatientService();
|
||||
$res = $UserPatientService->getNotFinishedOrdeInquiry($user_info['client_user_id']);
|
||||
if (!empty($res)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,"当前有未完成服务,不允许再次购买",[$res]);
|
||||
}
|
||||
|
||||
if (!empty($doctor_id)){
|
||||
|
||||
@ -2,9 +2,41 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Model\OrderInquiry;
|
||||
|
||||
/**
|
||||
* 患者
|
||||
*/
|
||||
class UserPatientService extends BaseService
|
||||
{
|
||||
/**
|
||||
* 获取患者未完成订单
|
||||
* @param string $patient_id
|
||||
* @param string $family_id
|
||||
* @return string
|
||||
*/
|
||||
public function getNotFinishedOrdeInquiry(string $patient_id = '',string $family_id = ''): string
|
||||
{
|
||||
$params = array();
|
||||
if (!empty($patient_id)){
|
||||
$params[] = ['patient_id','=',$patient_id];
|
||||
}
|
||||
|
||||
if (!empty($family_id)){
|
||||
$params[] = ['family_id','=',$family_id];
|
||||
}
|
||||
|
||||
$params[] = ['inquiry_mode','=',1];
|
||||
$params[] = ['inquiry_refund_status','=',0];
|
||||
$order_inquiry = OrderInquiry::getOne($params);
|
||||
if (!empty($order_inquiry)) {
|
||||
// 1:待支付 2:待分配 3:待接诊 4:已接诊
|
||||
if (in_array($order_inquiry['inquiry_status'], [1, 2, 3, 4])) {
|
||||
return $order_inquiry['order_inquiry_id'];
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user