From f9b638b56a154013ce58febe5e949f9427ee91a9 Mon Sep 17 00:00:00 2001 From: weiz <736250432@qq.com> Date: Tue, 23 Jan 2024 09:44:24 +0800 Subject: [PATCH] update --- app/common/model/contract/ProcurementContractDetail.php | 9 +++++++-- .../model/contract/SubcontractingContractDetail.php | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/common/model/contract/ProcurementContractDetail.php b/app/common/model/contract/ProcurementContractDetail.php index b24b2e4b4..1e74e5eaa 100644 --- a/app/common/model/contract/ProcurementContractDetail.php +++ b/app/common/model/contract/ProcurementContractDetail.php @@ -16,6 +16,7 @@ namespace app\common\model\contract; use app\common\model\BaseModel; +use app\common\model\dict\DictData; use think\model\concern\SoftDelete; @@ -29,6 +30,10 @@ class ProcurementContractDetail extends BaseModel use SoftDelete; protected $name = 'procurement_contract_detail'; protected $deleteTime = 'delete_time'; - - + + public function getTaxRateTextAttr($value,$data) + { + $dict = DictData::where('type_value','tax_rate')->column('name','value'); + return !empty($data['tax_rate']) ? $dict[$data['tax_rate']] : ''; + } } \ No newline at end of file diff --git a/app/common/model/contract/SubcontractingContractDetail.php b/app/common/model/contract/SubcontractingContractDetail.php index 2cb64f2a2..da28692b8 100644 --- a/app/common/model/contract/SubcontractingContractDetail.php +++ b/app/common/model/contract/SubcontractingContractDetail.php @@ -16,6 +16,7 @@ namespace app\common\model\contract; use app\common\model\BaseModel; +use app\common\model\dict\DictData; use think\model\concern\SoftDelete; @@ -30,4 +31,9 @@ class SubcontractingContractDetail extends BaseModel protected $name = 'subcontracting_contract_detail'; protected $deleteTime = 'delete_time'; + public function getTaxRateTextAttr($value,$data) + { + $dict = DictData::where('type_value','tax_rate')->column('name','value'); + return !empty($data['tax_rate']) ? $dict[$data['tax_rate']] : ''; + } } \ No newline at end of file