diff --git a/app/Controller/DoctorAccountController.php b/app/Controller/DoctorAccountController.php index e8cfe82..425cc92 100644 --- a/app/Controller/DoctorAccountController.php +++ b/app/Controller/DoctorAccountController.php @@ -89,4 +89,20 @@ class DoctorAccountController extends AbstractController $data = $DoctorAccountService->getDoctorWithdrawalRecordList(); return $this->response->json($data); } + + /** + * 发起提现 + * @return ResponseInterface + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface + */ + public function addDoctorWithdrawal(): ResponseInterface + { + $request = $this->container->get(DoctorAccountRequest::class); + $request->scene('addDoctorWithdrawal')->validateResolved(); + + $DoctorAccountService = new DoctorAccountService(); + $data = $DoctorAccountService->addDoctorWithdrawal(); + return $this->response->json($data); + } } \ No newline at end of file diff --git a/app/Model/OrderInquiry.php b/app/Model/OrderInquiry.php index 7e389a4..23155fe 100644 --- a/app/Model/OrderInquiry.php +++ b/app/Model/OrderInquiry.php @@ -174,7 +174,7 @@ class OrderInquiry extends Model public static function getDoctorOrderInquiryPage(array $params,array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed { $raw = self::where($params) - ->orderBy('finish_time') + ->orderBy('finish_time','desc') ->paginate($per_page, $fields, "page", $page); $data = array(); diff --git a/app/Request/DoctorAccountRequest.php b/app/Request/DoctorAccountRequest.php index 33053ce..c70233c 100644 --- a/app/Request/DoctorAccountRequest.php +++ b/app/Request/DoctorAccountRequest.php @@ -22,6 +22,10 @@ class DoctorAccountRequest extends FormRequest 'getDoctorWithdrawalInfo' => [ // 获取提现数据 'order_inquiry_ids', ], + 'addDoctorWithdrawal' => [ // 发起提现 + 'order_inquiry_ids', + 'order_inquiry_ids', + ], ]; /** diff --git a/config/routes.php b/config/routes.php index aab06f2..7cdadc7 100644 --- a/config/routes.php +++ b/config/routes.php @@ -135,6 +135,9 @@ Router::addGroup('/doctor', function () { // 获取医生提现记录列表 Router::get('/record', [DoctorAccountController::class, 'getDoctorWithdrawalRecordList']); + + // 发起提现 + Router::post('', [DoctorAccountController::class, 'addDoctorWithdrawal']); }); // 订单