@@ 50-60 (lines=11) @@ | ||
47 | } |
|
48 | ||
49 | switch ($type) { |
|
50 | case "username": |
|
51 | $this->paginate = [ |
|
52 | 'limit' => 15, |
|
53 | 'conditions' => [ |
|
54 | 'Users.username LIKE' => "%$keyword%" |
|
55 | ], |
|
56 | 'order' => [ |
|
57 | 'Users.username' => 'asc' |
|
58 | ] |
|
59 | ]; |
|
60 | break; |
|
61 | ||
62 | case "ip": |
|
63 | $this->paginate = [ |
|
@@ 62-72 (lines=11) @@ | ||
59 | ]; |
|
60 | break; |
|
61 | ||
62 | case "ip": |
|
63 | $this->paginate = [ |
|
64 | 'limit' => 15, |
|
65 | 'conditions' => [ |
|
66 | 'Users.last_login_ip LIKE' => "%$keyword%" |
|
67 | ], |
|
68 | 'order' => [ |
|
69 | 'Users.last_login_ip' => 'asc' |
|
70 | ] |
|
71 | ]; |
|
72 | break; |
|
73 | ||
74 | case "mail": |
|
75 | $this->paginate = [ |
|
@@ 74-84 (lines=11) @@ | ||
71 | ]; |
|
72 | break; |
|
73 | ||
74 | case "mail": |
|
75 | $this->paginate = [ |
|
76 | 'limit' => 15, |
|
77 | 'conditions' => [ |
|
78 | 'Users.email LIKE' => "%$keyword%" |
|
79 | ], |
|
80 | 'order' => [ |
|
81 | 'Users.email' => 'asc' |
|
82 | ] |
|
83 | ]; |
|
84 | break; |
|
85 | ||
86 | case "group": |
|
87 | $this->paginate = [ |
|
@@ 96-105 (lines=10) @@ | ||
93 | ]; |
|
94 | break; |
|
95 | ||
96 | default: |
|
97 | $this->paginate = [ |
|
98 | 'limit' => 15, |
|
99 | 'conditions' => [ |
|
100 | 'Users.username LIKE' => "%$keyword%" |
|
101 | ], |
|
102 | 'order' => [ |
|
103 | 'Users.username' => 'asc' |
|
104 | ] |
|
105 | ]; |
|
106 | } |
|
107 | ||
108 | $users = $this->paginate($this->Users->find()); |