erp/app/Models/GoodsSkuLocation.php

36 lines
645 B
PHP
Raw Permalink Normal View History

2023-04-03 20:25:57 +08:00
<?php
namespace App\Models;
use App\Models\traits\Filter;
class GoodsSkuLocation extends Model
{
use Filter;
public $fieldSearchable = [
'date',
'goods_title',
'goods_code',
'external_sku_id',
'location',
'status',
];
public function goods()
{
return $this->belongsTo(Goods::class, 'goods_id', 'id');
}
public function goodsSku()
{
return $this->belongsTo(GoodsSku::class, 'goods_sku_id', 'id');
}
public function getStatusAttribute($value)
{
$map = ['未使用', '正常', '过期'];
return $map[$value];
}
}