erp/app/Models/GoodsType.php

22 lines
367 B
PHP
Raw Permalink Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
class GoodsType extends Model
{
use SoftDeletes;
2022-07-28 13:46:08 +08:00
/**
* 数组中的属性会被隐藏。
*
* @var array
*/
protected $hidden = ['deleted_at'];
2024-08-12 19:36:42 +08:00
2024-08-14 17:02:31 +08:00
public function parentType()
2024-08-12 19:36:42 +08:00
{
2024-08-14 17:02:31 +08:00
return $this->hasOne(GoodsType::class, 'id', 'parent_id');
2024-08-12 19:36:42 +08:00
}
}