芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/qrafiqxcreativeagency.com/accounts/office/app/Models/OrderItems.php
withTrashed(); } public function orderItemImage(): HasOne { return $this->hasOne(OrderItemImage::class, 'order_item_id'); } public function product(): BelongsTo { return $this->belongsTo(Product::class, 'product_id'); } public function getTaxListAttribute() { $orderItem = OrderItems::findOrFail($this->id); $taxes = ''; if ($orderItem && $orderItem->taxes) { $numItems = count(json_decode($orderItem->taxes)); if (!is_null($orderItem->taxes)) { foreach (json_decode($orderItem->taxes) 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'); } }