记录数据创建者
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user