diff --git a/app/Model/UserDoctor.php b/app/Model/UserDoctor.php index 7b6192b..85546eb 100644 --- a/app/Model/UserDoctor.php +++ b/app/Model/UserDoctor.php @@ -196,7 +196,7 @@ class UserDoctor extends Model * @param int|null $per_page * @return array */ - public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [], string|int $sort_order = 1, array $fields = ["*"], ?int $per_page = 10, int $page = null): array + public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [], string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array { $query = self::with([ "Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id", diff --git a/app/Services/DoctorAccountService.php b/app/Services/DoctorAccountService.php index f2b33ec..9f2b96a 100644 --- a/app/Services/DoctorAccountService.php +++ b/app/Services/DoctorAccountService.php @@ -123,7 +123,7 @@ class DoctorAccountService extends BaseService $params['inquiry_status'] = 6; // inquiry_status:问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) $params['inquiry_refund_status'] = 0; // inquiry_refund_status:问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭) - $order_inquiry = OrderInquiry:: getDoctorDateOrderInquiryPage($params, $reception_time, $fields); + $order_inquiry = OrderInquiry:: getDoctorDateOrderInquiryPage($params, $reception_time, $fields,$page,$per_page); if (!empty($order_inquiry['data'])) { foreach ($order_inquiry['data'] as &$item) { $item['amount_total'] = $item['amount_total'] * 0.75; @@ -235,7 +235,7 @@ class DoctorAccountService extends BaseService $params['inquiry_status'] = 6; // inquiry_status:问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) $params['inquiry_refund_status'] = 0; // inquiry_refund_status:问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭) - $order_inquiry = OrderInquiry:: getDoctorOrderInquiryPage($params, $fields); + $order_inquiry = OrderInquiry:: getDoctorOrderInquiryPage($params, $fields,$page,$per_page); if (!empty($order_inquiry['data'])) { foreach ($order_inquiry['data'] as &$item) { $item['amount_total'] = $item['amount_total'] * 0.75; @@ -254,6 +254,8 @@ class DoctorAccountService extends BaseService $user_info = $this->request->getAttribute("userInfo") ?? []; $year = $this->request->input('year'); + $page = $this->request->input('page',1); + $per_page = $this->request->input('per_page',10); // 获取当年开始时间 $start_date = $year.'-1-1 00:00:00'; @@ -265,7 +267,7 @@ class DoctorAccountService extends BaseService $params = array(); $params['doctor_id'] = $user_info['client_user_id']; - $doctor_withdrawal = DoctorWithdrawal::getDatePage($params,$created_at_params); + $doctor_withdrawal = DoctorWithdrawal::getDatePage($params,$created_at_params,$page,$per_page); if (empty($doctor_withdrawal['data'])){ return success(); } diff --git a/app/Services/OrderPrescriptionService.php b/app/Services/OrderPrescriptionService.php index 9c51bf7..d3ee804 100644 --- a/app/Services/OrderPrescriptionService.php +++ b/app/Services/OrderPrescriptionService.php @@ -56,7 +56,7 @@ class OrderPrescriptionService extends BaseService $fields = []; $page = $this->request->input('page', 1); $per_page = $this->request->input('per_page', 10); - return OrderPrescription::getPage($params, $fields); + return OrderPrescription::getPage($params, $fields,$page,$per_page); } /** diff --git a/app/Services/PatientDoctorService.php b/app/Services/PatientDoctorService.php index 553bc5f..94205ff 100644 --- a/app/Services/PatientDoctorService.php +++ b/app/Services/PatientDoctorService.php @@ -87,7 +87,7 @@ class PatientDoctorService extends BaseService "be_good_at", ]; - $user_doctors = UserDoctor::getInquiryDoctorPage($keyword, $hospital_params, $doctor_params, $doctor_expertise_params, $sort_order, $fields,$per_page); + $user_doctors = UserDoctor::getInquiryDoctorPage($keyword, $hospital_params, $doctor_params, $doctor_expertise_params, $sort_order, $fields,$page,$per_page); // 处理数据 if (!empty($user_doctors['data'])) { @@ -410,12 +410,12 @@ class PatientDoctorService extends BaseService $params = array(); $params['patient_id'] = $user_info['client_user_id']; $params['history_status'] = 1; - $result = PatientHistoryInquiryModel::getPage($params); + $result = PatientHistoryInquiryModel::getPage($params,$page,$per_page); }else{ // 关注 $params = array(); $params['patient_id'] = $user_info['client_user_id']; - $result = PatientFollow::getPage($params); + $result = PatientFollow::getPage($params,$page,$per_page); } // 处理数据 diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index 7480fa5..ecf6e5c 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -82,7 +82,7 @@ class PatientOrderService extends BaseService 'patient_age', 'created_at', ]; - $order_inquiry = OrderInquiry::getPatientOrderInquiryPage($params,$inquiry_status_params,$fields); + $order_inquiry = OrderInquiry::getPatientOrderInquiryPage($params,$inquiry_status_params,$fields,$page,$per_page); if (empty($order_inquiry['data'])){ return success(); } @@ -418,7 +418,7 @@ class PatientOrderService extends BaseService 'created_at', ]; - $order_product = OrderProduct::getPatientOrderProductPage($params,$fields); + $order_product = OrderProduct::getPatientOrderProductPage($params,$fields,$page,$per_page); if (empty($order_product['data'])){ return success(); } diff --git a/app/Services/UserDoctorService.php b/app/Services/UserDoctorService.php index 98f3fb1..7da69cf 100644 --- a/app/Services/UserDoctorService.php +++ b/app/Services/UserDoctorService.php @@ -412,7 +412,7 @@ class UserDoctorService extends BaseService $params['doctor_id'] = $user_info['client_user_id']; $params['pharmacist_audit_status'] = $prescription_status; $params['is_delete'] = 0; - $order_prescriptions = OrderPrescription::getWithIcdPage($params); + $order_prescriptions = OrderPrescription::getWithIcdPage($params,$page,$per_page); if (empty($order_prescriptions)) { return success($order_prescriptions); } @@ -640,7 +640,7 @@ class UserDoctorService extends BaseService return fail(); } - $order_evaluation = OrderEvaluation::getScorePage($params, $avg_score_params); + $order_evaluation = OrderEvaluation::getScorePage($params, $avg_score_params,$page,$per_page); if (!empty($order_evaluation['data'])) { foreach ($order_evaluation['data'] as &$item) { $item['avg_score'] = floor($item['avg_score'] * 0.05);