This commit is contained in:
weiz 2024-01-23 09:44:24 +08:00
parent f61d2eba8c
commit f9b638b56a
2 changed files with 13 additions and 2 deletions

View File

@ -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']] : '';
}
}

View File

@ -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']] : '';
}
}