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,33 @@
<?php
namespace app\adminapi\logic\community;
use app\common\logic\BaseLogic;
use app\common\model\community\CommunityComment;
use app\common\model\community\CommunityPost;
class CommunityCommentLogic extends BaseLogic
{
public static function updateStatus(array $params): bool
{
try {
CommunityComment::update([
'id' => $params['id'],
'status' => $params['status'],
]);
return true;
} catch (\Exception $e) {
self::setError($e->getMessage());
return false;
}
}
public static function delete(array $params)
{
$comment = CommunityComment::findOrEmpty($params['id']);
if (!$comment->isEmpty()) {
CommunityPost::where('id', $comment->post_id)->dec('comment_count')->update();
$comment->delete();
}
}
}