付款申请查询相关字段名

This commit is contained in:
2025-09-23 16:45:06 +08:00
parent 4717bb01ca
commit e6d3cc3f04
4 changed files with 89 additions and 12 deletions
+28
View File
@@ -2,6 +2,7 @@
namespace app\common\service;
use app\common\model\FinReceiptHis;
use app\common\validate\FinReceiptValidate;
use app\common\traits\crud\CrudServiceTrait;
use app\common\model\FinReceipt;
@@ -50,10 +51,22 @@ class FinReceiptService
if (isset($p['country_id']) && !empty($p['country_id'])) {
$config['where']['country_id'] = $p['country_id'];
}
// 没有付款记录的收款记录
if (isset($p['payment_apply']) && $p['payment_apply'] == 'not') {
$config['where']['payment_apply_id'] = ['not null'];
}
// 收款账户筛选
if (isset($p['payment_apply_id']) && !empty($p['payment_apply_id'])) {
$config['where']['payment_apply_id'] = $p['payment_apply_id'];
}
// 收款账户筛选
if (isset($p['account_id']) && !empty($p['account_id'])) {
$config['where']['account_id'] = $p['account_id'];
}
// 关键字
if (isset($p['keyword']) && $p['keyword']) {
$k = '%' . $p['keyword'] . '%';
@@ -85,6 +98,14 @@ class FinReceiptService
return $data;
}
public function afterServiceStore($res)
{
$receipt = FinReceipt::where('id',$res->id)->first()->toArray();
$receipt = array_merge($receipt,['receipt_id' => $res->id]);
unset($receipt['id']);
FinReceiptHis::create($receipt);
}
public function beforeServiceUpdate($data, Request $request)
{
$data['updated_by'] = $request->user->uid;
@@ -92,6 +113,13 @@ class FinReceiptService
$data['received_at'] = strtotime( $data['received_at']);
return $data;
}
public function afterServiceUpdate($res)
{
$receipt = FinReceipt::where('id',$res->id)->first()->toArray();
$receipt = array_merge($receipt,['receipt_id' => $res->id]);
unset($receipt['id']);
FinReceiptHis::create($receipt);
}
/**