goodsnotices/app/Models/Good.php

34 lines
806 B
PHP
Raw Permalink Normal View History

2024-05-24 07:55:55 +00:00
<?php
namespace App\Models;
2024-05-24 11:04:29 +00:00
use Illuminate\Database\Eloquent\Relations\HasOne;
2024-05-24 07:55:55 +00:00
2024-05-24 11:04:29 +00:00
/**
2024-05-27 08:03:31 +00:00
* @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
2024-05-27 07:53:42 +00:00
* @property GoodsItem $item
2024-05-24 11:04:29 +00:00
*/
2024-05-25 14:06:58 +00:00
class Good extends Base
2024-05-24 07:55:55 +00:00
{
2024-05-25 14:06:58 +00:00
public $fillable = [
'itemid','typeid','product_name','product_code','product_group',
'market_price','settlement','category_id', 'category_name'
];
2024-05-26 14:06:21 +00:00
2024-05-27 07:43:40 +00:00
public function item(): HasOne
2024-05-26 14:06:21 +00:00
{
return $this->hasOne(GoodsItem::class, 'item_id', 'itemid');
2024-05-24 11:04:29 +00:00
}
2024-05-24 07:55:55 +00:00
}