From f64324fba536356ac882f5ce9f77954ec5d752a8 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Thu, 30 Oct 2025 16:29:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=9C=AA=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=85=A5=E8=B4=A6=E8=B5=84=E6=96=99=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/FinPaymentApplyController.php | 10 ++++++++++ app/common/service/FinPaymentApplyService.php | 20 +++++++++++++++++-- app/common/service/FinReceiptService.php | 2 ++ app/process/Task.php | 4 +++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/common/controller/FinPaymentApplyController.php b/app/common/controller/FinPaymentApplyController.php index 3bf4b15..6f29595 100644 --- a/app/common/controller/FinPaymentApplyController.php +++ b/app/common/controller/FinPaymentApplyController.php @@ -70,6 +70,16 @@ class FinPaymentApplyController extends BaseController $data['enter_file_last'] = date('Y-m-d H:i:s', ($data['claimed_at']+86400)); //入账资料最后提交时间 $data['claimed_at'] = date('Y-m-d H:i:s', $data['claimed_at']); //认领时间 } + if (isset($data['id'])){ + $finPaymentStock = FinPaymentStock::where('payment_apply_id', $data['id'])->get(); + $stock = []; + foreach ($finPaymentStock as $v) { + $stock[$v['pi_no']]['pi_no'] = $v['pi_no']; + $stock[$v['pi_no']]['stock_id'][] = [$v['stock_id']]; + } + $data['stock'] = array_values($stock); + } + return $data; } diff --git a/app/common/service/FinPaymentApplyService.php b/app/common/service/FinPaymentApplyService.php index e5091fd..ce2bbfd 100644 --- a/app/common/service/FinPaymentApplyService.php +++ b/app/common/service/FinPaymentApplyService.php @@ -58,6 +58,11 @@ class FinPaymentApplyService $config['where']['account_id'] = $p['account_id']; } + // 入账资料超时 + if (isset($p['scene']) && $p['scene'] == 'file_timeout') { + $config['where']['claimed_at'] = ['between', [1, time()-24*60*60]]; + } + // 关键字 if (isset($p['keyword']) && $p['keyword']) { $k = '%' . $p['keyword'] . '%'; @@ -156,7 +161,8 @@ class FinPaymentApplyService $param = $request->all(); $where = []; - + $orWhere = []; + // 汇款国家 if (isset($param['country_id']) && !empty($param['country_id'])) { $where[] = ['country_id', $param['country_id']]; @@ -166,6 +172,14 @@ class FinPaymentApplyService $where[] = ['account_id', $param['account_id']]; } + // 入账资料超时 + if (isset($param['scene']) && $param['scene'] == 'file_timeout') { + $where[] = ['claimed_at', '<', time()-24*60*60]; + $where[] = ['claimed_at', '>', 1]; + $orWhere[] = ['submit_files', '[]']; + $orWhere[] = ['submit_files', '']; + } + // 关键字 if (isset($param['keyword']) && $param['keyword']) { $k = '%' . $param['keyword'] . '%'; @@ -173,7 +187,9 @@ class FinPaymentApplyService } // 构建查询 - $query = $this->modelClass::where($where); + $query = $this->modelClass::where($where)->where(function($query) use ($orWhere) { + $query->orWhere($orWhere); + }); // 是否已关联收款记录的筛选 $correlation = $param['correlation']??''; diff --git a/app/common/service/FinReceiptService.php b/app/common/service/FinReceiptService.php index 52e3681..be72fc9 100644 --- a/app/common/service/FinReceiptService.php +++ b/app/common/service/FinReceiptService.php @@ -4,6 +4,7 @@ namespace app\common\service; use app\common\logic\FinReceiptLogic; use app\common\model\FinPaymentApply; +use app\common\model\FinPaymentStock; use app\common\model\FinReceiptHis; use app\common\validate\FinReceiptValidate; use app\common\traits\crud\CrudServiceTrait; @@ -295,6 +296,7 @@ class FinReceiptService $data = $this->preProcess(ucfirst($scene), $data, $request); $config = $this->buildQueryConfig($request, $scene); FinPaymentApply::where('id', $payment_apply_id)->update(['receipt_id' => $id, 'claimed_at' => time(), 'claimed_by' => $request->user->uid]); + FinPaymentStock::where('payment_apply_id', $payment_apply_id)->update(['receipt_id' => $id]); //折让金额 $payment = FinPaymentApply::where('id', $payment_apply_id)->first(); diff --git a/app/process/Task.php b/app/process/Task.php index 47dbb93..7175244 100644 --- a/app/process/Task.php +++ b/app/process/Task.php @@ -55,7 +55,9 @@ class Task ['created_at', '>', time() - 60 * 60 * 48], ['created_at', '<', time() - 60 * 60 * 24], ]; - $payment = FinPaymentApply::where($where)->orWhere($orWhere)->orderBy('id', 'desc')->get(); + $payment = FinPaymentApply::where($where)->where(function($query) use ($orWhere) { + $query->orWhere($orWhere); + })->orderBy('id', 'desc')->get(); foreach ($payment as $item) { Log::info('fin_payment_apply submit_files ', [$item->toArray()]); $notice = [