[api] add notifications

This commit is contained in:
xiaomlove
2022-03-31 16:28:08 +08:00
parent 3e4a5766c4
commit f91cd6f20a
28 changed files with 274 additions and 44 deletions
+3 -1
View File
@@ -39,11 +39,13 @@ class Comment extends NexusModel
],
];
public function scopeType(Builder $query, $type)
public function scopeType(Builder $query, string $type, int $typeValue)
{
foreach (self::TYPE_MAPS as $key => $value) {
if ($type != $key) {
$query->where($value['foreign_key'], 0);
} else {
$query->where($value['foreign_key'], $typeValue);
}
}
return $query;