记录数据创建者

This commit is contained in:
2025-06-06 14:08:10 +08:00
parent d75a9e1ae1
commit b044f2f215
7 changed files with 25 additions and 4 deletions
+5 -1
View File
@@ -47,7 +47,7 @@ class BrandModel extends Model
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'status', 'sort', 'toppic', 'descpic', 'logo', 'letter', 'is_hot', 'created_at', 'updated_at'];
protected $fillable = ['id', 'status', 'sort', 'toppic', 'descpic', 'logo', 'letter', 'is_hot', 'creater', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
@@ -73,4 +73,8 @@ class BrandModel extends Model
{
return $this->hasMany(BrandTraitModel::class, 'brand_id','id');
}
public function creater()
{
return $this->belongsTo(AdminsModel::class, 'creater','id');
}
}