品牌信息
This commit is contained in:
@@ -47,7 +47,7 @@ class BrandModel extends Model
|
||||
/**
|
||||
* 允许自动填充模型字段
|
||||
*/
|
||||
protected $fillable = ['id', 'status', 'sort', 'created_at', 'updated_at'];
|
||||
protected $fillable = ['id', 'status', 'sort', 'toppic', 'descpic', 'logo', 'letter', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* 不允许自动填充模型字段
|
||||
@@ -64,4 +64,13 @@ class BrandModel extends Model
|
||||
{
|
||||
return $this->hasMany(BrandTranslationModel::class, 'brand_id');
|
||||
}
|
||||
|
||||
public function banner()
|
||||
{
|
||||
return $this->hasMany(BrandBannerModel::class, 'brand_id','id');
|
||||
}
|
||||
public function trait()
|
||||
{
|
||||
return $this->hasMany(BrandTraitModel::class, 'brand_id','id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user