diff --git a/app/Controller/PatientOrderController.php b/app/Controller/PatientOrderController.php index ed055ac..d9bbdbb 100644 --- a/app/Controller/PatientOrderController.php +++ b/app/Controller/PatientOrderController.php @@ -92,4 +92,15 @@ class PatientOrderController extends AbstractController $data = $PatientOrderService->getPatientProductOrderList(); return $this->response->json($data); } + + /** + * 获取药品订单详情 + * @return ResponseInterface + */ + public function getPatientProductOrderInfo(): ResponseInterface + { + $PatientOrderService = new PatientOrderService(); + $data = $PatientOrderService->getPatientProductOrderInfo(); + return $this->response->json($data); + } } \ No newline at end of file diff --git a/app/Model/UserDoctor.php b/app/Model/UserDoctor.php index 399691d..7b6192b 100644 --- a/app/Model/UserDoctor.php +++ b/app/Model/UserDoctor.php @@ -53,10 +53,10 @@ use Hyperf\Utils\Arr; * @property string $brief_introduction 医生简介 * @property \Carbon\Carbon $created_at 创建时间 * @property \Carbon\Carbon $updated_at 修改时间 - * @property-read \Hyperf\Database\Model\Collection|DoctorExpertise[] $DoctorExpertise - * @property-read \Hyperf\Database\Model\Collection|DoctorInquiryConfig[] $DoctorInquiryConfig - * @property-read Hospital $Hospital - * @property-read \Hyperf\Database\Model\Collection|OrderInquiry[] $OrderInquiry + * @property-read \Hyperf\Database\Model\Collection|DoctorExpertise[] $DoctorExpertise + * @property-read \Hyperf\Database\Model\Collection|DoctorInquiryConfig[] $DoctorInquiryConfig + * @property-read Hospital $Hospital + * @property-read \Hyperf\Database\Model\Collection|OrderInquiry[] $OrderInquiry */ class UserDoctor extends Model { @@ -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 $page = null, ?int $per_page = 10): 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 { $query = self::with([ "Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id", diff --git a/app/Services/PatientDoctorService.php b/app/Services/PatientDoctorService.php index c135694..553bc5f 100644 --- a/app/Services/PatientDoctorService.php +++ b/app/Services/PatientDoctorService.php @@ -30,6 +30,8 @@ class PatientDoctorService extends BaseService $city_id = $this->request->input('city_id'); $sort_order = $this->request->input('sort_order'); $keyword = $this->request->input('keyword',""); + $page = $this->request->input('page',1); + $per_page = $this->request->input('per_page',10); // 组合条件 $hospital_params = array();// 医院搜索 @@ -85,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); + $user_doctors = UserDoctor::getInquiryDoctorPage($keyword, $hospital_params, $doctor_params, $doctor_expertise_params, $sort_order, $fields,$per_page); // 处理数据 if (!empty($user_doctors['data'])) { diff --git a/app/Services/PatientOrderService.php b/app/Services/PatientOrderService.php index af37e60..7480fa5 100644 --- a/app/Services/PatientOrderService.php +++ b/app/Services/PatientOrderService.php @@ -431,4 +431,28 @@ class PatientOrderService extends BaseService return success($order_product); } + + /** + * 获取药品订单详情 + * @return array + */ + public function getPatientProductOrderInfo(): array + { + $user_info = $this->request->getAttribute("userInfo") ?? []; + + $order_product_id = $this->request->route('order_product_id'); + + // 获取订单数据 + $params = array(); + $params['patient_id'] = $user_info['client_user_id']; + $params['order_product_id'] = $order_product_id; + $params['is_delete'] = 0; + $order_product = OrderInquiry::getOne($params); + if (empty($order_product)){ + return fail(); + } + + + + } } \ No newline at end of file diff --git a/config/routes.php b/config/routes.php index 7723187..d67527d 100644 --- a/config/routes.php +++ b/config/routes.php @@ -301,13 +301,13 @@ Router::addGroup('/patient', function () { Router::get('', [PatientOrderController::class, 'getPatientProductOrderList']); // 获取药品订单详情 - Router::post('/8', [PatientOrderController::class, 'imCallBack']); + Router::post('/{order_product_id:\d+}', [PatientOrderController::class, 'getPatientProductOrderInfo']); // 药品订单取消支付-1未支付 Router::put('/cancel-pay/{order_inquiry_id:\d+}', [PatientOrderController::class, 'putPatientInquiryOrderCancelPay']); // 创建处方订单 - Router::post('/17', [PatientOrderController::class, 'imCallBack']); + Router::post('/121212da', [PatientOrderController::class, 'imCallBack']); }); // 处方订单