Merge branch 'develop'

# Conflicts:
#	app/admin/controller/dashboard/FinStatisticsController.php
#	app/common/controller/FinPaymentApplyController.php
#	app/common/controller/FinReceiptController.php
#	app/common/logic/FinReceiptLogic.php
#	app/common/model/FinPaymentApply.php
#	app/common/model/FinReceipt.php
#	app/common/service/FinPaymentApplyService.php
#	app/common/service/FinReceiptService.php
#	app/common/service/StockOrdersService.php
#	config/route.php
This commit is contained in:
mzl
2025-11-04 10:36:52 +08:00
parent 359755fdf1
commit aabd0f4634
10 changed files with 321 additions and 39 deletions
+27 -1
View File
@@ -127,6 +127,13 @@ class FinPaymentApplyService
return $data;
}
public function afterServiceUpdate($res, Request $request)
{
if($res->submit_files != '' && $res->receipt_id != 0)
FinReceipt::where('id', $res->receipt_id)->update(['submit_files' => $res->submit_files]);
}
/**
* 生成唯一的付款申请编码
* 格式:PA + 日期 + 6位字母数字组合
@@ -207,7 +214,19 @@ class FinPaymentApplyService
$query->whereDoesntHave('receipt');
}
if ((isset($param['scene']) && $param['scene'] == 'list') || empty($param['receipt_id'])) {
if(isset($param['scene']) && $param['scene'] == 'pending'){ //待入账列表
$query->where('receipt_id', '>' ,'0');
$query->where('submit_files','!=','');
$query->whereNull('received_at');
}
if($param['scene'] == 'delete'){ //查询作废数据
$query->onlyTrashed();
}elseif ($param['scene'] == 'all'){ //查询包含作废数据的全量数据
$query->withTrashed();
}
if ((isset($param['scene']) && ($param['scene'] == 'list' || $param['scene'] == 'pending'))|| empty($param['receipt_id']) ) {
return $query->orderBy('id','desc')->paginate($limit, ['*'], 'page', $page);
}
@@ -264,4 +283,11 @@ class FinPaymentApplyService
return $query->paginate($limit, ['*'], 'page', $page);
}
public function delete($id)
{
$res = FinPaymentApply::where('id', $id)->delete();
return $res;
}
}