From b479d059bc2551b86f27a60eea2a3f648370aba3 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Mon, 10 Feb 2025 15:32:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E7=A5=A8=E5=A4=B1=E8=B4=A5=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/api/InvoiceIssuance.php | 23 +++++++++++++++++++++++ route/apiRoute.php | 1 + 2 files changed, 24 insertions(+) diff --git a/app/controller/api/InvoiceIssuance.php b/app/controller/api/InvoiceIssuance.php index b056cc4..e2bbd11 100644 --- a/app/controller/api/InvoiceIssuance.php +++ b/app/controller/api/InvoiceIssuance.php @@ -285,6 +285,29 @@ class InvoiceIssuance extends Base return $this->buildSuccess(['qrCodeImage' => $qrCodeImage]); } + public function getErrorInfo() + { + try { + // 验证 + $id = $this->request->get('id', ''); + if (empty($id)) { + throw new \Exception('缺少必传参数'); + } + $status = InvoiceIssuanceModel::where('id', $id)->value('status'); + if ($status != 2) { + throw new \Exception('失败原因获取失败'); + } + $ycms = InvoiceIssuanceData::where(['invoice_issuance_id' => $id, 'status' => 1])->value('ycms'); + if (!$ycms) { + throw new \Exception('暂无失败原因'); + } + + return $this->buildSuccess(['content' => $ycms]); + } catch (\Exception $e) { + return $this->buildFailed(ReturnCode::NOT_EXISTS,$e->getMessage()); + } + } + public function downFile() { try { diff --git a/route/apiRoute.php b/route/apiRoute.php index fac5538..c1aff7e 100644 --- a/route/apiRoute.php +++ b/route/apiRoute.php @@ -14,6 +14,7 @@ Route::group('api', function() { Route::rule('InvoiceIssuance/delete', 'api.InvoiceIssuance/delete', 'post')->middleware(\app\middleware\WechatAuth::class); Route::rule('InvoiceIssuance/getList', 'api.InvoiceIssuance/getList', 'post')->middleware(\app\middleware\WechatAuth::class); Route::rule('InvoiceIssuance/getQrCode', 'api.InvoiceIssuance/getQrCode', 'get')->middleware(\app\middleware\WechatAuth::class); + Route::rule('InvoiceIssuance/getErrorInfo', 'api.InvoiceIssuance/getErrorInfo', 'get')->middleware(\app\middleware\WechatAuth::class); Route::rule('InvoiceIssuance/validateFeePay', 'api.InvoiceIssuance/validateFeePay', 'post')->middleware(\app\middleware\WechatAuth::class); // 测试FeeService 接口 Route::rule('Test/index', 'api.Test/index', 'get');