GroupHasMemberFilter.php
1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace App\ModelFilters;
use App\Support\ModelFilter;
class GroupHasMemberFilter extends ModelFilter
{
public function memberNickName(string $name): void
{
$this->whereRelation('member', 'nick_name', 'like', '%' . $name . '%');
}
public function memberRealName(string $name): void
{
$this->whereRelation('member', 'real_name', 'like', '%' . $name . '%');
}
public function memberEmailLike(string $email): void
{
$this->whereRelation('member', 'email', 'like', '%' . $email . '%');
}
public function memberPhoneLike(string $phone): void
{
$this->whereRelation('member', 'phone', 'like', '%' . $phone . '%');
}
public function memberOfficialStatus(int $status): void
{
$this->whereRelation('member', 'official_status', $status);
}
public function memberStatus(int $status): void
{
$this->whereRelation('member', 'status', $status);
}
public function member(int $memberId): void
{
$this->where('member_id', $memberId);
}
public function master(int $masterId): void
{
$this->whereRelation('master', 'users.id', $masterId);
}
public function role(int $role): void
{
$this->where('role', $role);
}
public function status(int $status): void
{
$this->where('status', $status);
}
public function group(int $group): void
{
$this->where('group_id', $group);
}
}