column('name','value'); return !empty($data['invoice_type']) ? $dict[$data['invoice_type']] : ''; } public function getInvoiceTaxRateTextAttr($value,$data){ $dict = DictData::where('type_value','tax_rate')->column('name','value'); return !empty($data['invoice_tax_rate']) ? $dict[$data['invoice_tax_rate']] : ''; } public function getContractTypeTextAttr($value,$data): string { $type = [1=>'采购合同',2=>'分包合同']; return $type[$data['contract_type']]; } }