修正问诊类目录
This commit is contained in:
@@ -8,6 +8,7 @@ use App\Model\DiseaseClassExpertise;
|
||||
use App\Model\Hospital;
|
||||
use App\Model\HospitalDepartmentCustom;
|
||||
use App\Model\OperationManual;
|
||||
use App\Model\Product;
|
||||
|
||||
/**
|
||||
* 基础数据服务类
|
||||
@@ -189,4 +190,36 @@ class BasicDataService extends BaseService
|
||||
$disease_class_expertise = DiseaseClassExpertise::getOrderList($params,$fields);
|
||||
return success($disease_class_expertise);
|
||||
}
|
||||
|
||||
public function getProductSearch(){
|
||||
$product_keyword = $this->request->input('product_keyword');
|
||||
|
||||
$fields = [
|
||||
'product_id',
|
||||
'product_name',
|
||||
'product_cover_img',
|
||||
'product_spec',
|
||||
'manufacturer',
|
||||
'single_unit',
|
||||
'single_use',
|
||||
'packaging_unit',
|
||||
'frequency_use',
|
||||
'available_days',
|
||||
];
|
||||
$params = array();
|
||||
$params[] = ['product_name','like','%' . $product_keyword . '%'];
|
||||
|
||||
$product = Product::getList($params,$fields);
|
||||
if (empty($product)){
|
||||
return success();
|
||||
}
|
||||
|
||||
foreach ($product as &$item){
|
||||
$item['product_cover_img'] = addAliyunOssWebsite($item['product_cover_img']);
|
||||
|
||||
$item['product_name'] = $item['product_name'] . ' ' . $item['product_spec'];
|
||||
}
|
||||
|
||||
return success($product->toArray());
|
||||
}
|
||||
}
|
||||
@@ -63,14 +63,14 @@ class IndexService extends BaseService
|
||||
return fail(HttpEnumCode::USER_STATUS_ERROR);
|
||||
}
|
||||
|
||||
$OrderInquiryService = new OrderInquiryService();
|
||||
$InquiryService = new InquiryService();
|
||||
$OrderPrescriptionService = new OrderPrescriptionService();
|
||||
|
||||
// 获取未接诊患者个数
|
||||
$not_accepted_inquiry_num = $OrderInquiryService->getDoctorNotAcceptedInquiryNum($doctor['doctor_id']);
|
||||
$not_accepted_inquiry_num = $InquiryService->getDoctorNotAcceptedInquiryNum($doctor['doctor_id']);
|
||||
|
||||
// 获取接诊中患者个数
|
||||
$accepting_inquiry_num = $OrderInquiryService->getDoctorAcceptingInquiryNum($doctor['doctor_id']);
|
||||
$accepting_inquiry_num = $InquiryService->getDoctorAcceptingInquiryNum($doctor['doctor_id']);
|
||||
|
||||
// 获取被驳回处方数据
|
||||
$reject_prescription_number = $OrderPrescriptionService->getDoctorExistsAuditFail($doctor['doctor_id']);
|
||||
|
||||
@@ -4,17 +4,13 @@ namespace App\Services;
|
||||
|
||||
use App\Amqp\Producer\AmqpDelayDirectProducer;
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Exception\BusinessException;
|
||||
use App\Model\DiseaseClass;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\InquiryCaseProduct;
|
||||
use App\Model\OrderInquiry;
|
||||
use App\Model\OrderInquiryCase;
|
||||
use App\Model\OrderInquiryCoupon;
|
||||
use App\Model\PatientFamily;
|
||||
use App\Model\Product;
|
||||
use App\Model\ProductPlatformAmount;
|
||||
use App\Model\SystemInquiryConfig;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Utils\PcreMatch;
|
||||
use Hyperf\Amqp\Producer;
|
||||
@@ -24,85 +20,10 @@ use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
/**
|
||||
* 问诊订单
|
||||
* 问诊
|
||||
*/
|
||||
class OrderInquiryService extends BaseService
|
||||
class InquiryService extends BaseService
|
||||
{
|
||||
/**
|
||||
* 获取医生未接诊订单数量
|
||||
* @param string $doctor_id 医生id
|
||||
* @return int
|
||||
*/
|
||||
public function getDoctorNotAcceptedInquiryNum(string $doctor_id): int
|
||||
{
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['inquiry_status'] = 3; // 待接诊
|
||||
$params['inquiry_refund_status'] = 0; // 无退款
|
||||
|
||||
$order_inquiry_count = OrderInquiry::getCount($params);
|
||||
if (!empty($order_inquiry_count) || $order_inquiry_count != 0) {
|
||||
$not_accepted_inquiry_num = $order_inquiry_count;
|
||||
} else {
|
||||
$not_accepted_inquiry_num = $order_inquiry_count;
|
||||
}
|
||||
|
||||
return $not_accepted_inquiry_num;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生接诊中订单数量
|
||||
* @param string $doctor_id 医生id
|
||||
* @return int
|
||||
*/
|
||||
public function getDoctorAcceptingInquiryNum(string $doctor_id): int
|
||||
{
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['inquiry_status'] = 4; // 已接诊
|
||||
$params['inquiry_refund_status'] = 0; // 无退款
|
||||
|
||||
$order_inquiry_count = OrderInquiry::getCount($params);
|
||||
if (!empty($order_inquiry_count) || $order_inquiry_count != 0) {
|
||||
$accepting_inquiry_num = $order_inquiry_count;
|
||||
} else {
|
||||
$accepting_inquiry_num = $order_inquiry_count;
|
||||
}
|
||||
|
||||
return $accepting_inquiry_num;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生当日接诊的订单金额
|
||||
* 状态:已接诊-已完成
|
||||
* @param string $doctor_id
|
||||
* @param string $date
|
||||
* @return float
|
||||
*/
|
||||
public function getDoctorDayAmountTotal(string $doctor_id, string $date): float
|
||||
{
|
||||
// 获取当天开始时间
|
||||
$start_date = date('Y-m-d 00:00:00', strtotime($date));
|
||||
|
||||
// 获取当天结束时间
|
||||
$end_date = date('Y-m-d 23:59:59', strtotime($date));
|
||||
|
||||
// 获取医生当日接诊订单金额
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['inquiry_refund_status'] = 0; // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭)
|
||||
$params['inquiry_pay_status'] = 2; // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
|
||||
$params['settlement_status'] = 0; // 订单与医生结算状态(0:未结算 1:已结算)
|
||||
|
||||
$reception_time = [$start_date, $end_date];
|
||||
|
||||
$inquiry_status_params = [4, 5]; // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
|
||||
$amount_total_sum = OrderInquiry::getOrderInquiryAmountTotalSum($params, $reception_time, $inquiry_status_params);
|
||||
|
||||
return $amount_total_sum ?: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建问诊订单
|
||||
* @return array
|
||||
@@ -335,4 +256,79 @@ class OrderInquiryService extends BaseService
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生未接诊订单数量
|
||||
* @param string $doctor_id 医生id
|
||||
* @return int
|
||||
*/
|
||||
public function getDoctorNotAcceptedInquiryNum(string $doctor_id): int
|
||||
{
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['inquiry_status'] = 3; // 待接诊
|
||||
$params['inquiry_refund_status'] = 0; // 无退款
|
||||
|
||||
$order_inquiry_count = OrderInquiry::getCount($params);
|
||||
if (!empty($order_inquiry_count) || $order_inquiry_count != 0) {
|
||||
$not_accepted_inquiry_num = $order_inquiry_count;
|
||||
} else {
|
||||
$not_accepted_inquiry_num = $order_inquiry_count;
|
||||
}
|
||||
|
||||
return $not_accepted_inquiry_num;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生接诊中订单数量
|
||||
* @param string $doctor_id 医生id
|
||||
* @return int
|
||||
*/
|
||||
public function getDoctorAcceptingInquiryNum(string $doctor_id): int
|
||||
{
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['inquiry_status'] = 4; // 已接诊
|
||||
$params['inquiry_refund_status'] = 0; // 无退款
|
||||
|
||||
$order_inquiry_count = OrderInquiry::getCount($params);
|
||||
if (!empty($order_inquiry_count) || $order_inquiry_count != 0) {
|
||||
$accepting_inquiry_num = $order_inquiry_count;
|
||||
} else {
|
||||
$accepting_inquiry_num = $order_inquiry_count;
|
||||
}
|
||||
|
||||
return $accepting_inquiry_num;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生当日接诊的订单金额
|
||||
* 状态:已接诊-已完成
|
||||
* @param string $doctor_id
|
||||
* @param string $date
|
||||
* @return float
|
||||
*/
|
||||
public function getDoctorDayAmountTotal(string $doctor_id, string $date): float
|
||||
{
|
||||
// 获取当天开始时间
|
||||
$start_date = date('Y-m-d 00:00:00', strtotime($date));
|
||||
|
||||
// 获取当天结束时间
|
||||
$end_date = date('Y-m-d 23:59:59', strtotime($date));
|
||||
|
||||
// 获取医生当日接诊订单金额
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
$params['inquiry_refund_status'] = 0; // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭)
|
||||
$params['inquiry_pay_status'] = 2; // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
|
||||
$params['settlement_status'] = 0; // 订单与医生结算状态(0:未结算 1:已结算)
|
||||
|
||||
$reception_time = [$start_date, $end_date];
|
||||
|
||||
$inquiry_status_params = [4, 5]; // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
|
||||
|
||||
$amount_total_sum = OrderInquiry::getOrderInquiryAmountTotalSum($params, $reception_time, $inquiry_status_params);
|
||||
|
||||
return $amount_total_sum ?: 0;
|
||||
}
|
||||
}
|
||||
@@ -485,8 +485,8 @@ class UserDoctorService extends BaseService
|
||||
}
|
||||
|
||||
// 获取医生当日接诊的订单金额
|
||||
$OrderInquiryService = new OrderInquiryService();
|
||||
$estimate_income = $OrderInquiryService->getDoctorDayAmountTotal($user_info['client_user_id'],date('Y-m-d',time()));
|
||||
$InquiryService = new InquiryService();
|
||||
$estimate_income = $InquiryService->getDoctorDayAmountTotal($user_info['client_user_id'],date('Y-m-d',time()));
|
||||
if (!empty($estimate_income)){
|
||||
$estimate_income = $estimate_income * 0.75;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user