Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
Compass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zong
Compass
Commits
405fcc14
Commit
405fcc14
authored
Jan 04, 2020
by
biao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
05c8023b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
44 deletions
+29
-44
compass_db_schema.xlsx
doc/DB/compass_db_schema.xlsx
+0
-0
AcountModule.inc
src/cn/compass/entity/definition/AcountModule.inc
+29
-44
No files found.
doc/DB/compass_db_schema.xlsx
View file @
405fcc14
No preview for this file type
src/cn/compass/entity/definition/A
uthorityLevel
.inc
→
src/cn/compass/entity/definition/A
countModule
.inc
View file @
405fcc14
...
@@ -5,16 +5,14 @@
...
@@ -5,16 +5,14 @@
* @author zongbiao
* @author zongbiao
* @package jp.fishow.entity.definition
* @package jp.fishow.entity.definition
*/
*/
class
A
uthorityLevel
class
A
countModule
{
{
public
$id
;
public
$id
;
public
$level
;
public
$module
;
public
$model
;
function
__construct
(
$record
)
{
function
__construct
(
$record
)
{
$this
->
id
=
$record
[
"id"
];
$this
->
id
=
$record
[
"id"
];
$this
->
level
=
$record
[
"level"
];
$this
->
module
=
$record
[
"module"
];
$this
->
model
=
$record
[
"model"
];
}
}
/**
/**
...
@@ -27,33 +25,42 @@ class AuthorityLevel
...
@@ -27,33 +25,42 @@ class AuthorityLevel
if
((
!
is_array
(
$result
))
||
(
count
(
$result
)
<
1
))
{
if
((
!
is_array
(
$result
))
||
(
count
(
$result
)
<
1
))
{
$data
=
array
();
$data
=
array
();
//系统管理员
$tmp
=
array
(
"id"
=>
1
,
"module"
=>
"账户管理"
);
$tmp
=
array
(
"id"
=>
1
,
"level"
=>
"0"
,
"model"
=>
"ACCOUNT|EVENT|CHECK"
);
array_push
(
$data
,
$tmp
);
array_push
(
$data
,
$tmp
);
//省厅级权限
$tmp
=
array
(
"id"
=>
2
,
"module"
=>
"领导机构管理"
);
$tmp
=
array
(
"id"
=>
2
,
"level"
=>
"1"
,
"model"
=>
"ACCOUNT|CHECK"
);
array_push
(
$data
,
$tmp
);
array_push
(
$data
,
$tmp
);
//市级权限
$tmp
=
array
(
"id"
=>
3
,
"module"
=>
"学校管理);
$tmp
=
array
(
"id"
=>
3
,
"level"
=>
"2"
,
"model"
=>
"ACCOUNT|CHECK"
);
array_push(
$data
,
$tmp
);
array_push(
$data
,
$tmp
);
//区县管局权限
$tmp
= array("
id
"=>4, "
module
"=>"
班级管理
");
$tmp
=
array
(
"id"
=>
4
,
"level"
=>
"3"
,
"model"
=>
"ACCOUNT|CHECK"
);
array_push(
$data
,
$tmp
);
array_push(
$data
,
$tmp
);
//学校级别权限
$tmp
= array("
id
"=>5, "
module
"=>"
公益活动发布
");
$tmp
=
array
(
"id"
=>
5
,
"level"
=>
"4"
,
"model"
=>
"ACCOUNT|CHECK"
);
array_push(
$data
,
$tmp
);
array_push(
$data
,
$tmp
);
//班级级别权限
$tmp
= array("
id
"=>6, "
module
"=>"
公益活动审核
");
$tmp
=
array
(
"id"
=>
6
,
"level"
=>
"5"
,
"model"
=>
"ACCOUNT|CHECK"
);
array_push(
$data
,
$tmp
);
$tmp
= array("
id
"=>7, "
module
"=>"
社会实践发布
");
array_push(
$data
,
$tmp
);
$tmp
= array("
id
"=>8, "
module
"=>"
社会实践审核
");
array_push(
$data
,
$tmp
);
$tmp
= array("
id
"=>9, "
module
"=>"
亲子活动发布
");
array_push(
$data
,
$tmp
);
$tmp
= array("
id
"=>10, "
module
"=>"
亲子活动审核
");
array_push(
$data
,
$tmp
);
$tmp
= array("
id
"=>11, "
module
"=>"
公益课堂管理
");
array_push(
$data
,
$tmp
);
array_push(
$data
,
$tmp
);
$result
= array();
$result
= array();
foreach (
$data
as
$row
) {
foreach (
$data
as
$row
) {
$tmp2
=
new
A
uthorityLevel
(
$row
);
$tmp2
= new A
countModule
(
$row
);
array_push(
$result
,
$tmp2
);
array_push(
$result
,
$tmp2
);
}
}
}
}
...
@@ -62,10 +69,10 @@ class AuthorityLevel
...
@@ -62,10 +69,10 @@ class AuthorityLevel
/**
/**
* IDから対応するインスタンスを返します。
* IDから対応するインスタンスを返します。
* @return A
uthorityLevel
対応するインスタンス。ない場合null。
* @return A
countModule
対応するインスタンス。ない場合null。
*/
*/
public static function getById(
$id
) {
public static function getById(
$id
) {
$list
=
A
uthorityLevel
::
getList
();
$list
= A
countModule
::getList();
foreach (
$list
as
$tmp
) {
foreach (
$list
as
$tmp
) {
if (
$tmp->id
==
$id
) {
if (
$tmp->id
==
$id
) {
return
$tmp
;
return
$tmp
;
...
@@ -76,10 +83,10 @@ class AuthorityLevel
...
@@ -76,10 +83,10 @@ class AuthorityLevel
/**
/**
* 定義名から対応するインスタンスを返します。
* 定義名から対応するインスタンスを返します。
* @return A
uthorityLevel
対応するインスタンス。ない場合null。
* @return A
countModule
対応するインスタンス。ない場合null。
*/
*/
public static function getByName(
$name
) {
public static function getByName(
$name
) {
$list
=
A
uthorityLevel
::
getList
();
$list
= A
countModule
::getList();
foreach (
$list
as
$tmp
) {
foreach (
$list
as
$tmp
) {
if (
$tmp->name
==
$name
) {
if (
$tmp->name
==
$name
) {
return
$tmp
;
return
$tmp
;
...
@@ -87,25 +94,4 @@ class AuthorityLevel
...
@@ -87,25 +94,4 @@ class AuthorityLevel
}
}
return null;
return null;
}
}
/**
* 通过定义名取得标题,用于显示
* @return
*/
public
static
function
getTitlesByNames
(
$names
)
{
if
(
empty
(
$names
))
{
return
"拥有全部权限"
;
}
if
(
!
is_array
(
$names
))
{
$names
=
explode
(
","
,
$names
);
}
$list
=
AuthorityLevel
::
getList
();
$result
=
array
();
foreach
(
$list
as
$tmp
)
{
if
(
in_array
(
$tmp
->
name
,
$names
))
{
array_push
(
$result
,
$tmp
->
title
);
}
}
return
implode
(
","
,
$result
);
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment