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
c6737c3e
Commit
c6737c3e
authored
Feb 18, 2020
by
biao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
91731872
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
117 deletions
+50
-117
UserStatus.inc
src/cn/compass/entity/definition/UserStatus.inc
+0
-116
compass_include.inc
src/settings/compass_include.inc
+1
-1
ajax_get_user_role.php
src/user/if/ajax_get_user_role.php
+49
-0
No files found.
src/cn/compass/entity/definition/UserStatus.inc
deleted
100644 → 0
View file @
91731872
<?php
/**
* 用户状态表
* $Id$
* @author zongbiao
* @package jp.fishow.entity.definition
*/
class
UserStatus
{
public
$id
;
public
$title
;
function
__construct
(
$record
)
{
$this
->
id
=
$record
[
"id"
];
$this
->
title
=
$record
[
"title"
];
}
/**
* このクラスのインスタンスのリストを返します。
* @return array ImageType一覧
*/
public
static
function
getList
()
{
static
$result
;
if
((
!
is_array
(
$result
))
||
(
count
(
$result
)
<
1
))
{
$data
=
array
();
$tmp
=
array
(
"id"
=>-
1
,
"title"
=>
"未注册访客"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
1
,
"title"
=>
"新注册用户"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
2
,
"title"
=>
"信息错误"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
3
,
"title"
=>
"有意向"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
4
,
"title"
=>
"不报名"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
5
,
"title"
=>
"已付费[N5]"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
6
,
"title"
=>
"已付费[N4]"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
7
,
"title"
=>
"已付费[N3]"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
8
,
"title"
=>
"已付费[N2]"
);
array_push
(
$data
,
$tmp
);
$tmp
=
array
(
"id"
=>
9
,
"title"
=>
"已付费[N1]"
);
array_push
(
$data
,
$tmp
);
$result
=
array
();
foreach
(
$data
as
$row
)
{
$tmp2
=
new
UserStatus
(
$row
);
array_push
(
$result
,
$tmp2
);
}
}
return
$result
;
}
/**
* IDから対応するインスタンスを返します。
* @return UserStatus 対応するインスタンス。ない場合null。
*/
public
static
function
getById
(
$id
)
{
$list
=
UserStatus
::
getList
();
foreach
(
$list
as
$tmp
)
{
if
(
$tmp
->
id
==
$id
)
{
return
$tmp
;
}
}
return
null
;
}
/**
* 定義名から対応するインスタンスを返します。
* @return UserStatus 対応するインスタンス。ない場合null。
*/
public
static
function
getTitleById
(
$id
)
{
$list
=
UserStatus
::
getList
();
foreach
(
$list
as
$tmp
)
{
if
(
$tmp
->
id
==
$id
)
{
return
$tmp
->
title
;
}
}
return
null
;
}
/**
* 通过定义名取得标题,用于显示
* @return
*/
public
static
function
getTitlesByNames
(
$names
)
{
if
(
empty
(
$names
))
{
return
"拥有全部权限"
;
}
if
(
!
is_array
(
$names
))
{
$names
=
explode
(
","
,
$names
);
}
$list
=
UserStatus
::
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
src/settings/compass_include.inc
View file @
c6737c3e
...
...
@@ -38,6 +38,7 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/CourseMediaDat.inc");
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/CertificateMst.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserCertificateDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/UserMessageDat.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/GovernmentQrDat.inc"
);
// definition
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/ImageType.inc"
);
...
...
@@ -45,7 +46,6 @@ require_once(COMPASS_LIB_ROOT . "/cn/compass/entity/definition/PointActionType.i
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/SchoolType.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/UserRole.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/ChildAgeRange.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/UserStatus.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/EventScope.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/AccountRole.inc"
);
require_once
(
COMPASS_LIB_ROOT
.
"/cn/compass/entity/definition/AuthorityLevel.inc"
);
...
...
src/user/if/ajax_get_user_role.php
0 → 100644
View file @
c6737c3e
<?php
// 获取用户身份标识
require_once
(
"../user_include.inc"
);
ErrorLogger
::
doOutput
(
"Compass...ajax_get_user_role.php....Start."
,
0
);
//获取参数
$unionId
=
ParamUtil
::
getRequestString
(
"unionId"
);
//参数检查
if
(
empty
(
$unionId
))
{
$result
[
"message"
]
=
"参数错误!"
;
responseNG
(
$result
);
}
$result
=
array
();
//判断用户是否存在
$param
=
array
();
$param
[
'unionid'
]
=
$unionId
;
$param
[
'delete_flg'
]
=
false
;
$userList
=
UserMst
::
getList
(
$param
,
'id'
,
'desc'
,
0
,
1
);
if
(
empty
(
$userList
))
{
$result
[
"message"
]
=
"用户不存在!"
;
responseNG
(
$result
);
}
$role
=
$userList
[
0
]
->
id
;
//接口返回数据
$result
[
"role"
]
=
$role
;
ErrorLogger
::
doOutput
(
"Compass...ajax_get_user_role.php....End."
,
0
);
//返回结果
responseOK
(
$result
);
function
responseNG
(
$result
)
{
$result
=
array
(
"status"
=>
"NG"
,
"result"
=>
$result
);
print
json_encode
(
$result
);
exit
;
}
function
responseOK
(
$result
)
{
$result
=
array
(
"status"
=>
"OK"
,
"result"
=>
$result
);
print
json_encode
(
$result
);
exit
;
}
?>
\ 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