初始化
缺陷:主题配色需要优化整体的同风格
This commit is contained in:
26
app/Models/business/CategoryModel.php
Normal file
26
app/Models/business/CategoryModel.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\business;
|
||||
|
||||
use App\BaseApp\BaseBusinessModel;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* 商品分类(cc_category)
|
||||
*/
|
||||
class CategoryModel extends BaseBusinessModel
|
||||
{
|
||||
protected $table = 'category';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
public function children(): HasMany
|
||||
{
|
||||
return $this->hasMany(self::class, 'pid', 'id');
|
||||
}
|
||||
|
||||
public function catalogues(): HasMany
|
||||
{
|
||||
return $this->hasMany(CatalogueModel::class, 'category_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user