no message

This commit is contained in:
hajimi
2026-06-11 12:15:29 +08:00
parent 10ebe39c30
commit 96efa1d905
5859 changed files with 815501 additions and 5 deletions
@@ -0,0 +1,38 @@
<?php
namespace app\adminapi\validate\community;
use app\common\validate\BaseValidate;
use app\common\model\community\CommunityComment;
class CommunityCommentValidate extends BaseValidate
{
protected $rule = [
'id' => 'require|checkComment',
'status' => 'require|in:0,1',
];
protected $message = [
'id.require' => '评论id不能为空',
'status.require' => '状态不能为空',
];
public function sceneDelete()
{
return $this->only(['id']);
}
public function sceneStatus()
{
return $this->only(['id', 'status']);
}
public function checkComment($value)
{
$comment = CommunityComment::findOrEmpty($value);
if ($comment->isEmpty()) {
return '评论不存在';
}
return true;
}
}