update
This commit is contained in:
@ -26,6 +26,10 @@ class NewsFormModel
|
||||
public function insert()
|
||||
{
|
||||
$model = new AppNews();
|
||||
$this->attributes['column_tag'] = $this->attributes['column1'] ?: 0;
|
||||
$this->attributes['second_column'] = $this->attributes['column2'] ?: 0;
|
||||
unset($this->attributes['column1']);
|
||||
unset($this->attributes['column2']);
|
||||
$model->setRawAttributes($this->attributes);
|
||||
$model->save();
|
||||
}
|
||||
@ -39,6 +43,8 @@ class NewsFormModel
|
||||
$model->cover = $this->attributes['cover'];
|
||||
$model->content = $this->attributes['content'];
|
||||
$model->platform = $this->attributes['platform'];
|
||||
$model->column_tag = $this->attributes['column1'] ?: 0;
|
||||
$model->second_column = $this->attributes['column2'] ?: 0;
|
||||
$model->save();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user