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