erp/app/Models/DailyReport.php

35 lines
646 B
PHP
Raw Permalink Normal View History

2024-02-04 17:20:06 +08:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class DailyReport extends Model
{
protected $guarded = [];
protected $casts = [
'shop_data' => 'array',
];
2024-02-06 17:04:58 +08:00
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');
}
2024-02-04 17:20:06 +08:00
}