60 lines
1.9 KiB
PHP
60 lines
1.9 KiB
PHP
<?php
|
||
|
||
namespace App\Services;
|
||
|
||
use App\Model\OrderPrescription;
|
||
use Hyperf\Contract\LengthAwarePaginatorInterface;
|
||
|
||
class OrderPrescriptionService extends BaseService
|
||
{
|
||
/**
|
||
* 获取医生是否存在被驳回处方
|
||
* @param string $doctor_id 医生id
|
||
* @return bool
|
||
*/
|
||
public function getDoctorExistsAuditFail(string $doctor_id): bool
|
||
{
|
||
$params = array();
|
||
$params['doctor_id'] = $doctor_id;
|
||
$params['pharmacist_audit_status'] = 2;// 处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||
$params['platform_audit_status'] = 1;// 处方平台审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||
$params['is_delete'] = 0;// 是否删除(0:否 1:是)
|
||
return OrderPrescription::getExists($params);
|
||
}
|
||
|
||
/**
|
||
* 获取药师待审核处方-分页-存在问题,需修改
|
||
* @param string $pharmacist_id 药师id
|
||
* @return array
|
||
*/
|
||
public function getPharmacistWaitAuditPage(string $pharmacist_id): array
|
||
{
|
||
$params = array();
|
||
$params['pharmacist_id'] = $pharmacist_id;
|
||
$params['pharmacist_audit_status'] = 0; //处方审核状态(0:审核中 1:审核成功 2:审核驳回)
|
||
|
||
// $fields = [
|
||
// "order_prescription_id",
|
||
// "order_inquiry_id",
|
||
// "doctor_id",
|
||
// "pharmacist_id",
|
||
// "prescription_status",
|
||
// "pharmacist_audit_status",
|
||
// "is_delete",
|
||
// "is_pass",
|
||
// "prescription_code",
|
||
// "not_pass_reason",
|
||
// "audit_fail_reason",
|
||
// "doctor_name",
|
||
// "patient_name",
|
||
// "patient_sex",
|
||
// "patient_age",
|
||
// "created_at",
|
||
// ];
|
||
|
||
$page = $this->request->input('page', 1);
|
||
$per_page = $this->request->input('per_page', 10);
|
||
return OrderPrescription::getPage($params, $fields);
|
||
}
|
||
|
||
} |