refactor: 去除附件中status字段相关
This commit is contained in:
@@ -75,7 +75,6 @@ class Attachment
|
||||
'attach',
|
||||
'sort',
|
||||
'recommend',
|
||||
'status',
|
||||
'seo_title',
|
||||
'seo_keywords',
|
||||
'seo_desc'
|
||||
@@ -188,25 +187,6 @@ class Attachment
|
||||
return success('操作成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁/启用
|
||||
*/
|
||||
public function enable()
|
||||
{
|
||||
$id = request()->param('id');
|
||||
|
||||
$attachment = AttachmentModel::bypk($id)->find();
|
||||
if (empty($attachment)) {
|
||||
return error('请确认操作对象是否存在');
|
||||
}
|
||||
|
||||
$attachment->status = $attachment->status == 1 ? -1 : 1;
|
||||
if (!$attachment->save()) {
|
||||
return error('操作失败');
|
||||
}
|
||||
return success('操作成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 附件删除
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,6 @@ class AttachmentBaseModel extends BaseModel
|
||||
'attach' => 'json',
|
||||
'sort' => 'int',
|
||||
'recommend' => 'int',
|
||||
'status' => 'int',
|
||||
'seo_title' => 'string',
|
||||
'seo_keywords' => 'string',
|
||||
'seo_desc' => 'string',
|
||||
|
||||
Reference in New Issue
Block a user