<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class DailyReport extends Model
{
    protected $guarded = [];

    protected $casts = [
        'shop_data' => 'array',
    ];

    public function goods()
    {
        return $this->hasOne(Goods::class, 'id', 'goods_id');
    }

    public function goodsBrand()
    {
        return $this->belongsTo(GoodsBrand::class, 'brand_id', 'id');
    }

    public function goodsType()
    {
        return $this->belongsTo(GoodsType::class, 'type_id', 'id');
    }

    public function goodsSku()
    {
        return $this->hasOne(GoodsSku::class, 'id', 'goods_sku_id');
    }
}
