修正全部分页问题

This commit is contained in:
wucongxing 2023-03-11 15:11:16 +08:00
parent 9030031041
commit 9a311d78f3
6 changed files with 14 additions and 12 deletions

View File

@ -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",

View File

@ -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();
}

View File

@ -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);
}
/**

View File

@ -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);
}
// 处理数据

View File

@ -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();
}

View File

@ -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);