mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
[api] add notifications
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user