Browse Source

开票失败查看原因

master
wanghongjun 10 months ago
parent
commit
b479d059bc
  1. 23
      app/controller/api/InvoiceIssuance.php
  2. 1
      route/apiRoute.php

23
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 {

1
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');

Loading…
Cancel
Save