1
0
Fork 0

Update ReblogService

This commit is contained in:
Daniel Supernault 2022-03-10 23:55:32 -07:00
parent aef373a91c
commit ebe9c54dae
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 10 additions and 2 deletions

View File

@ -50,11 +50,19 @@ class ReblogService
public static function addPostReblog($parentId, $reblogId) public static function addPostReblog($parentId, $reblogId)
{ {
return Redis::zadd(self::REBLOGS_KEY . $parentId, $reblogId); $pid = intval($parentId);
$id = intval($reblogId);
if($pid && $id) {
return Redis::zadd(self::REBLOGS_KEY . $pid, $id);
}
} }
public static function removePostReblog($parentId, $reblogId) public static function removePostReblog($parentId, $reblogId)
{ {
return Redis::zrem(self::REBLOGS_KEY . $parentId, $reblogId); $pid = intval($parentId);
$id = intval($reblogId);
if($pid && $id) {
return Redis::zrem(self::REBLOGS_KEY . $pid, $id);
}
} }
} }