goodsnotices/app/Models/Good.php
2024-05-27 16:03:31 +08:00

34 lines
806 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\HasOne;
/**
* @property int $itemid
* @property int $typeid
* @property string $product_name
* @property string $product_code
* @property string $product_group
* @property float $market_price
* @property float $settlement
* @property int $category_id
* @property string $category_name
* @property int $state
* @property string $created_at
* @property string $updated_at
* @property GoodsItem $item
*/
class Good extends Base
{
public $fillable = [
'itemid','typeid','product_name','product_code','product_group',
'market_price','settlement','category_id', 'category_name'
];
public function item(): HasOne
{
return $this->hasOne(GoodsItem::class, 'item_id', 'itemid');
}
}