feat: 新增文章评论审核/反审核接口
This commit is contained in:
@@ -43,4 +43,23 @@ class ArticleLeaveMessage
|
||||
|
||||
return success('获取成功', $data);
|
||||
}
|
||||
|
||||
// 审核/反审核
|
||||
public function audit()
|
||||
{
|
||||
// 获取参数
|
||||
$id = request()->param('id');
|
||||
|
||||
// 审核/反审核
|
||||
$message = ArticleLeaveMessageModel::id($id)->find();
|
||||
if (is_null($message)) {
|
||||
return error('请确认操作对象');
|
||||
}
|
||||
$message->is_audited = (int)!$message->is_audited;
|
||||
if (!$message->save()) {
|
||||
return error('操作失败');
|
||||
}
|
||||
|
||||
return success('操作成功');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user