Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
hujun
tl_estate
Commits
e00b61e4
Commit
e00b61e4
authored
Jan 31, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编辑调整
parent
75c4099c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
19 deletions
+25
-19
Agent.php
application/index/controller/Agent.php
+11
-4
Auth.php
application/index/controller/Auth.php
+12
-13
route.php
application/route.php
+2
-2
No files found.
application/index/controller/Agent.php
View file @
e00b61e4
...
...
@@ -108,7 +108,15 @@ class Agent extends Basic
$data
=
input
(
'post.'
);
$id
=
isset
(
$data
[
'id'
])
&&
$data
[
'id'
]
>
0
?
$data
[
'id'
]
:
false
;
//新增或者编辑数据
if
(
empty
(
$data
[
'id'
])){
$data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$id
=
''
;
}
else
{
$data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
,
time
());
$id
=
$data
[
'id'
];
}
//判断name是否重复
if
(
$table
->
repetition
(
'phone'
,
$data
[
'phone'
])
&&
empty
(
$id
)){
...
...
@@ -116,8 +124,7 @@ class Agent extends Basic
}
//新增或者编辑数据
//prt($data);
if
(
$table
->
editData
(
$data
,
$id
))
{
return
$this
->
response
(
200
,
'成功'
);
...
...
@@ -173,7 +180,7 @@ class Agent extends Basic
$data
=
$this
->
request
->
param
();
$ids
=
$data
[
'ids'
];
//1.清空原有数据
if
(
!
empty
(
$ids
)
&&!
empty
(
$data
[
'group_id'
])
&&!
empty
(
$data
[
'idname'
])
){
if
(
!
empty
(
$ids
)
&&!
empty
(
$data
[
'group_id'
])){
if
(
$table2
->
delUid
(
$data
[
'idname'
],
$ids
)){
//2.从新分发角色
...
...
application/index/controller/Auth.php
View file @
e00b61e4
...
...
@@ -115,12 +115,13 @@ class Auth extends Basic
* post存在id为新增
*
* */
public
function
addAuth
(
$group_id
=
0
){
$title
=
$group_id
?
'编辑'
:
'新增'
;
public
function
addAuth
(){
$group_id
=
$this
->
request
->
param
(
'id'
);
$table
=
New
AuthGroup
();
if
(
empty
(
$group_id
))
{
if
(
$this
->
request
->
isPost
(
))
{
$data
=
input
(
'post.'
);
$err
=
$this
->
validateData
(
$data
,
[
...
...
@@ -143,7 +144,7 @@ class Auth extends Basic
}
else
{
$info
=
$table
->
where
(
"id=
{
$group_id
}
"
)
->
find
();
return
$this
->
response
(
200
,
$title
,
$info
);
return
$this
->
response
(
200
,
'取值'
,
$info
);
}
...
...
@@ -172,13 +173,14 @@ class Auth extends Basic
* @date 2018-01-22
* @author zfc
*/
public
function
accessLook
(
$group_id
=
0
){
public
function
accessLook
(){
$table
=
New
AuthGroup
;
$table2
=
new
authRule
;
$group_id
=
$this
->
request
->
param
(
'id'
);
$data
[
'title'
]
=
'权限分配'
;
// echo $group_id;
// exit;
if
(
IS_POST
&&
$group_id
==
0
)
{
if
(
$this
->
request
->
isPost
()
)
{
//添加or修改
$data
[
'id'
]
=
$group_id
;
$menu_auth
=
input
(
'post.menu_auth/a'
,
''
);
//获取所有授权菜单id
...
...
@@ -300,15 +302,12 @@ class Auth extends Basic
}
}
//新增编辑权限
public
function
updateAuthRule
(
$group_id
=
0
){
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$title
=
$group_id
?
'编辑'
:
'新增'
;
public
function
updateAuthRule
(){
$group_id
=
$this
->
request
->
param
(
'id'
);
$table
=
New
AuthRule
;
if
(
IS_POST
&&
$group_id
==
0
)
{
if
(
$this
->
request
->
isPost
()
)
{
$data
=
input
(
'post.'
);
...
...
@@ -337,7 +336,7 @@ class Auth extends Basic
$join
=
[[
'auth_rule b'
,
' a.pid=b.id'
,
'left'
]];
$info
=
$table
->
authRuleList2
(
$order
,
$field
,
$join
,
$where
);
//echo $table->getLastSql();
return
$this
->
response
(
200
,
$title
,
$info
[
0
]);
return
$this
->
response
(
200
,
'取值'
,
$info
[
0
]);
}
...
...
application/route.php
View file @
e00b61e4
...
...
@@ -84,7 +84,7 @@ Route::group('index', [
'roleedit'
=>
[
'index/auth/roleEdit'
,
[
'method'
=>
'get'
]],
//--编辑角色页面
'access'
=>
[
'index/auth/access'
,
[
'method'
=>
'get'
]],
//--权限分配角色页面
'updateAccess'
=>
[
'index/auth/updateAccess'
,
[
'method'
=>
'post'
]],
//--编辑角色权限【接口】
'addAuth'
=>
[
'index/auth/addAuth'
,
[
'method'
=>
'post'
]],
//--添加角色【接口】
'addAuth'
=>
[
'index/auth/addAuth'
,
[
'method'
=>
'
get|
post'
]],
//--添加角色【接口】
'accessLook'
=>
[
'index/auth/accessLook'
,
[
'method'
=>
'post'
]],
//--查看编辑角色权限【接口】
'setStatus'
=>
[
'index/auth/setStatus'
,
[
'method'
=>
'post'
]],
//--设置角色的状态【接口】
...
...
@@ -92,7 +92,7 @@ Route::group('index', [
'authRuleIndex'
=>
[
'index/auth/authRuleIndex'
,
[
'method'
=>
'get'
]],
//权限列表界面
'authRuleList'
=>
[
'index/auth/authRuleList'
,
[
'method'
=>
'get'
]],
//--规则列表
'authRuleBox'
=>
[
'index/auth/authRuleBox'
,
[
'method'
=>
'get'
]],
//--编辑规则
'updateAuthRule'
=>
[
'index/auth/updateAuthRule'
,
[
'method'
=>
'post'
]],
//--编辑规则接口
'updateAuthRule'
=>
[
'index/auth/updateAuthRule'
,
[
'method'
=>
'
get|
post'
]],
//--编辑规则接口
'authClass'
=>
[
'index/auth/authClass'
,
[
'method'
=>
'get'
]],
//--规则分类列表
'agent'
=>
[
'index/agent/agent'
,
[
'method'
=>
'get'
]],
//列表
...
...
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