From 1094bc406f093040c3ab5a0e039fbf3390b7b0cc Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Sat, 1 Nov 2025 13:22:45 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Revert=20"=E4=BD=9C=E5=BA=9F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 139d3509f44973f8468fe7bf28b4f4d4362c0047. --- app/common/controller/FinReceiptController.php | 16 ---------------- app/common/model/FinReceipt.php | 2 -- app/common/service/FinReceiptService.php | 13 ------------- config/route.php | 2 +- 4 files changed, 1 insertion(+), 32 deletions(-) diff --git a/app/common/controller/FinReceiptController.php b/app/common/controller/FinReceiptController.php index aeca0eb..cade259 100644 --- a/app/common/controller/FinReceiptController.php +++ b/app/common/controller/FinReceiptController.php @@ -41,22 +41,6 @@ class FinReceiptController extends BaseController } } - /** - * 确认入账 - * @param Request $request - * @return \support\Response - */ - public function delete(Request $request) - { - try { - $id = $request->input('id'); - $raw = $this->service->delete($id); - return $this->success($raw); - } catch (\Throwable $e) { - return $this->error($e->getMessage()); - } - } - public function show(Request $request) { try { diff --git a/app/common/model/FinReceipt.php b/app/common/model/FinReceipt.php index 099697f..88d3090 100644 --- a/app/common/model/FinReceipt.php +++ b/app/common/model/FinReceipt.php @@ -2,12 +2,10 @@ namespace app\common\model; -use Illuminate\Database\Eloquent\SoftDeletes; use support\Model; class FinReceipt extends Model { - use SoftDeletes; /** * The connection name for the model. * diff --git a/app/common/service/FinReceiptService.php b/app/common/service/FinReceiptService.php index 5b04368..6dd69a7 100644 --- a/app/common/service/FinReceiptService.php +++ b/app/common/service/FinReceiptService.php @@ -233,12 +233,6 @@ class FinReceiptService $query->where('submit_files','!=',''); } - if($param['scene'] == 'delete'){ //查询作废数据 - $query->onlyTrashed(); - }elseif ($param['scene'] == 'all'){ //查询包含作废数据的全量数据 - $query->withTrashed(); - } - if (isset($param['scene']) && ($param['scene'] == 'list' ||$param['scene'] == 'pending')) { return $query->paginate($limit, ['*'], 'page', $page); } @@ -299,13 +293,6 @@ class FinReceiptService return $res; } - - public function delete($id) - { - $res = FinReceipt::where('id', $id)->delete(); - return $res; - } - /** * 更新:绑定收款记录,计算折让金额 * @param Request $request diff --git a/config/route.php b/config/route.php index e313549..ec7d821 100644 --- a/config/route.php +++ b/config/route.php @@ -359,8 +359,8 @@ Route::group('/admin', function () { Route::any('/store', [app\common\controller\FinReceiptController::class, 'store']); Route::any('/update', [app\common\controller\FinReceiptController::class, 'update']); Route::any('/payment', [app\common\controller\FinReceiptController::class, 'payment']); + Route::any('/destroy', [app\common\controller\FinReceiptController::class, 'destroy']); Route::any('/credit', [app\common\controller\FinReceiptController::class, 'credit']); - Route::any('/delete', [app\common\controller\FinReceiptController::class, 'delete']); }); // 收款记录历史 Route::group('/receipt/his', function () { From 8674063e6e0a8254781ce1a26f8383310fedb291 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Sat, 1 Nov 2025 13:36:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=98=E6=AC=BE=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E4=BD=9C=E5=BA=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FinPaymentApplyController.php | 16 ++++++++++++++++ app/common/model/FinPaymentApply.php | 4 +++- app/common/service/FinPaymentApplyService.php | 13 +++++++++++++ config/route.php | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/app/common/controller/FinPaymentApplyController.php b/app/common/controller/FinPaymentApplyController.php index d58c1d6..98c49c2 100644 --- a/app/common/controller/FinPaymentApplyController.php +++ b/app/common/controller/FinPaymentApplyController.php @@ -162,4 +162,20 @@ class FinPaymentApplyController extends BaseController $data['stock'] = array_values($stock); return $data; } + + /** + * 作废 + * @param Request $request + * @return \support\Response + */ + public function delete(Request $request) + { + try { + $id = $request->input('id'); + $raw = $this->service->delete($id); + return $this->success($raw); + } catch (\Throwable $e) { + return $this->error($e->getMessage()); + } + } } \ No newline at end of file diff --git a/app/common/model/FinPaymentApply.php b/app/common/model/FinPaymentApply.php index 8dbe4f9..c81ac0a 100644 --- a/app/common/model/FinPaymentApply.php +++ b/app/common/model/FinPaymentApply.php @@ -2,10 +2,12 @@ namespace app\common\model; +use Illuminate\Database\Eloquent\SoftDeletes; use support\Model; class FinPaymentApply extends Model { + use SoftDeletes; /** * The connection name for the model. * @@ -40,7 +42,7 @@ class FinPaymentApply extends Model /** * 允许自动填充模型字段 */ - protected $fillable = ['id', 'apply_no', 'doc_user_id', 'sales_user_id', 'corp_id', 'account_id', 'payment_account', 'payment_entity', 'entity_type', 'currency_id', 'amount', 'swift', 'remit_bank', 'country_id', 'remitter', 'exchange_rate', 'total_amount_cny', 'voucher_file', 'voucher_name', 'submit_files','receipt_id','claimed_at','warn', 'created_at', 'updated_at', 'claimed_by',]; + protected $fillable = ['id', 'apply_no', 'doc_user_id', 'sales_user_id', 'corp_id', 'account_id', 'payment_account', 'payment_entity', 'entity_type', 'currency_id', 'amount', 'swift', 'remit_bank', 'country_id', 'remitter', 'exchange_rate', 'total_amount_cny', 'voucher_file', 'voucher_name', 'submit_files','receipt_id','claimed_at','warn', 'created_at', 'updated_at', 'deleted_at', 'claimed_by', 'created_by',]; /** * 不允许自动填充模型字段 diff --git a/app/common/service/FinPaymentApplyService.php b/app/common/service/FinPaymentApplyService.php index e659a86..4567461 100644 --- a/app/common/service/FinPaymentApplyService.php +++ b/app/common/service/FinPaymentApplyService.php @@ -214,6 +214,12 @@ class FinPaymentApplyService $query->whereDoesntHave('receipt'); } + if($param['scene'] == 'delete'){ //查询作废数据 + $query->onlyTrashed(); + }elseif ($param['scene'] == 'all'){ //查询包含作废数据的全量数据 + $query->withTrashed(); + } + if ((isset($param['scene']) && $param['scene'] == 'list') || empty($param['receipt_id'])) { return $query->orderBy('id','desc')->paginate($limit, ['*'], 'page', $page); } @@ -271,4 +277,11 @@ class FinPaymentApplyService return $query->paginate($limit, ['*'], 'page', $page); } + public function delete($id) + { + $res = FinPaymentApply::where('id', $id)->delete(); + return $res; + } + + } \ No newline at end of file diff --git a/config/route.php b/config/route.php index ec7d821..c390d7a 100644 --- a/config/route.php +++ b/config/route.php @@ -378,7 +378,7 @@ Route::group('/admin', function () { Route::any('/show', [app\common\controller\FinPaymentApplyController::class, 'show']); Route::any('/store', [app\common\controller\FinPaymentApplyController::class, 'store']); Route::any('/update', [app\common\controller\FinPaymentApplyController::class, 'update']); - Route::any('/destroy', [app\common\controller\FinPaymentApplyController::class, 'destroy']); + Route::any('/delete', [app\common\controller\FinPaymentApplyController::class, 'delete']); }); // 系统配置