<?php

namespace App\Models;

use App\Models\traits\Filter;

class BusinessAfterSaleOrder extends Model
{
    use Filter;

    protected $table = 'business_after_sale_orders';

    protected $fillable = [
        'after_sales_biz_sn',
    ];

    public $fieldSearchable = [
        'after_sales_status',
        "shop_id",
        "order_sn",
        "after_sales_biz_sn"
    ];

    public function getImageListAttribute($value)
    {
        return !empty($value) ? json_decode($value, true) : $value;
    }

    public function getSubExtensionsAttribute($value)
    {
        return !empty($value) ? json_decode($value, true) : $value;
    }
    public function shop()
    {
        return $this->belongsTo(Shop::class, 'shop_id', 'id');
    }
}
