记录数据创建者

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 VehicleNewModel extends Model
/**x`
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'vin', 'brand', 'cover', 'album', 'price', 'type', 'energy', 'model', 'video', 'views', 'created_at', 'updated_at', 'location'];
protected $fillable = ['id', 'vin', 'brand', 'cover', 'album', 'price', 'type', 'energy', 'model', 'video', 'views', 'creater', 'created_at', 'updated_at', 'location'];
/**
* 不允许自动填充模型字段
@@ -118,4 +118,8 @@ class VehicleNewModel extends Model
{
return $this->hasMany(VehicleNewContentModel::class, 'vehicle_id', 'id');
}
public function creater()
{
return $this->belongsTo(AdminsModel::class, 'creater','id');
}
}