From 6417f82028280c5b8d1684dfcf2167d7ba776abe Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 18 Dec 2023 11:43:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logic/finance/FinanceInvoiceApplyLogic.php | 10 ++++++++++ app/common/model/cost/CostBudget.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/adminapi/logic/finance/FinanceInvoiceApplyLogic.php b/app/adminapi/logic/finance/FinanceInvoiceApplyLogic.php index 07c7d8ee5..8955fdc97 100644 --- a/app/adminapi/logic/finance/FinanceInvoiceApplyLogic.php +++ b/app/adminapi/logic/finance/FinanceInvoiceApplyLogic.php @@ -17,6 +17,9 @@ namespace app\adminapi\logic\finance; use app\common\model\finance\FinanceInvoiceApply; use app\common\logic\BaseLogic; +use app\common\model\project\Project; +use app\common\model\custom\Custom; +use app\common\model\bid\BidBuyBiddingDocument; use think\facade\Db; @@ -158,6 +161,13 @@ class FinanceInvoiceApplyLogic extends BaseLogic $financeInvoiceApply = FinanceInvoiceApply::findOrEmpty($params['id']); $financeInvoiceApply->contract; $financeInvoiceApply->custom; + $financeInvoiceApply->document = null; + if (!empty($financeInvoiceApply->contract->buy_bidding_document_id)) { + $financeInvoiceApply->document = BidBuyBiddingDocument::findOrEmpty($financeInvoiceApply->contract->buy_bidding_document_id); + } + if (!empty($financeInvoiceApply->document->project_id)) { + $financeInvoiceApply->project = Custom::findOrEmpty($financeInvoiceApply->document->project_id); + } return $financeInvoiceApply->toArray(); } } \ No newline at end of file diff --git a/app/common/model/cost/CostBudget.php b/app/common/model/cost/CostBudget.php index c984cbeeb..52449b35f 100644 --- a/app/common/model/cost/CostBudget.php +++ b/app/common/model/cost/CostBudget.php @@ -40,6 +40,6 @@ class CostBudget extends BaseModel public function detail() { return $this->hasMany(\app\common\model\cost\CostBudgetDetail::class, 'cost_budget_id', 'id'); - } + } } \ No newline at end of file