UserManageActivityFilter.php
2.24 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
namespace App\ModelFilters;
use App\Support\ModelFilter;
use Arr;
class UserManageActivityFilter extends ModelFilter
{
/**
* @param string $name
* @return void
*/
public function nickName(string $name): void
{
$this->whereRelation('user', 'nick_name', 'like', '%' . $name . '%');
}
/**
* @param string $name
* @return void
*/
public function realName(string $name): void
{
$this->whereRelation('user', 'real_name', 'like', '%' . $name . '%');
}
/**
* @param string $name
* @return void
*/
public function songName(string $name): void
{
$this->whereRelation('activity', 'song_name', 'like', '%' . $name . '%');
}
/**
* @param string $name
* @return void
*/
public function projectName(string $name): void
{
$this->whereRelation('project', 'name', 'like', '%' . $name . '%');
}
/**
* @param string $email
* @return void
*/
public function email(string $email): void
{
$this->whereRelation('user', 'email', 'like', '%' . $email . '%');
}
/**
* @param string $phone
* @return void
*/
public function phone(string $phone): void
{
$this->whereRelation('user', 'phone', 'like', '%' . $phone . '%');
}
/**
* @param int $status
* @return void
*/
public function status(int $status): void
{
$this->whereRelation('user', 'status', $status);
}
/**
* @param array|int $key
* @return void
*/
public function activityKey(array|int $key): void
{
$this->whereIn('activity_id', Arr::wrap($key));
}
/**
* @param array|int $key
* @return void
*/
public function project(array|int $key): void
{
$this->whereIn('project_id', Arr::wrap($key));
}
/**
* @param array|int $status
* @return void
*/
public function activityStatus(array|int $status): void
{
$this->whereIn('activity_status', Arr::wrap($status));
}
/**
* @param string $permission
* @return void
*/
public function permission(string $permission): void
{
$this->whereJsonContains('permission', $permission);
}
}