芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Models/EstimateItem.php
withTrashed(); } public function estimateItemImage(): HasOne { return $this->hasOne(EstimateItemImage::class, 'estimate_item_id'); } public function unit(): BelongsTo { return $this->belongsTo(UnitType::class, 'unit_id'); } public function getTaxListAttribute() { $estimateItem = EstimateItem::findOrFail($this->id); $taxes = ''; if ($estimateItem && $estimateItem->taxes) { $numItems = count(json_decode($estimateItem->taxes)); if (!is_null($estimateItem->taxes)) { foreach (json_decode($estimateItem->taxes) as $index => $tax) { $tax = $this->taxbyid($tax)->first(); $taxes .= $tax->tax_name . ': ' . $tax->rate_percent . '%'; $taxes = ($index + 1 != $numItems) ? $taxes . ', ' : $taxes; } } } return $taxes; } }