Repository navigation
Expand file tree
/
Copy pathManage_GroupController.php
More file actions
72 lines (58 loc) · 1.67 KB
/
Copy pathManage_GroupController.php
File metadata and controls
72 lines (58 loc) · 1.67 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
<?php
/**
* Created by PhpStorm.
* User: anguoyue
* Date: 15/08/2018
* Time: 10:59 AM
*/
class Manage_GroupController extends Manage_CommonController
{
public function doRequest()
{
$params = ["lang" => $this->language];
//get user list by page
$offset = $_POST['offset'];
$length = $_POST['length'];
if (!$offset) {
$offset = 0;
}
if (!$length) {
$length = 2000;
}
// totalGroupCount
$params['totalGroupCount'] = $this->getTotalGroupCount();
$groupList = $this->getGroupListByOffset($offset, $length);
if ($groupList) {
$groupProfiles = [];
foreach ($groupList as $group) {
$groupProfiles[] = [
'groupId' => $group['groupId'],
'name' => htmlspecialchars($group['name']),
];
}
$params['groupList'] = $groupProfiles;
}
echo $this->display("manage_group_indexList", $params);
return;
}
private function getTotalGroupCount()
{
$tag = __CLASS__ . "->" . __FUNCTION__;
try {
return $this->ctx->SiteGroupTable->getSiteGroupCount();
} catch (Exception $e) {
$this->logger->error($tag, $e);
}
return 0;
}
private function getGroupListByOffset($offset, $length)
{
$tag = __CLASS__ . "->" . __FUNCTION__;
try {
return $this->ctx->SiteGroupTable->getSiteGroupListByOffset($offset, $length);
} catch (Exception $e) {
$this->ctx->Wpf_Logger->info($tag, $e);
}
return [];
}
}