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
f383d40f
Commit
f383d40f
authored
Feb 01, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
总监列表
parent
7ae97ce9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
35 deletions
+77
-35
Broker.php
application/index/controller/Broker.php
+16
-3
Basic.php
application/index/extend/Basic.php
+22
-32
AAgents.php
application/model/AAgents.php
+39
-0
No files found.
application/index/controller/Broker.php
View file @
f383d40f
...
...
@@ -174,15 +174,27 @@ class Broker extends Basic
* 总监列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getDistrictList
()
{
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$agents
=
new
AAgents
();
$field
=
'id,name,create_time,phone'
;
$where
[
'level'
]
=
[
'IN'
,
'30,40'
]
;
$field
=
'id,name,create_time,phone
,district_id
'
;
$where
[
'level'
]
=
40
;
$where
[
'status'
]
=
0
;
$this
->
data
=
$agents
->
getList
(
$pageNo
,
$pageSize
,
''
,
$field
,
''
,
$where
);
if
(
isset
(
$this
->
params
[
'name'
]))
{
$where
[
'name'
]
=
[
'LIKE'
,
$this
->
params
[
'name'
]
.
'%'
];
}
if
(
isset
(
$this
->
params
[
'phone'
]))
{
$where
[
'phone'
]
=
[
'LIKE'
,
$this
->
params
[
'phone'
]
.
'%'
];
}
$this
->
data
=
$agents
->
getListDistrict
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
\ No newline at end of file
application/index/extend/Basic.php
View file @
f383d40f
...
...
@@ -62,48 +62,38 @@ class Basic extends Controller
}
$this
->
userAuth
(
$requestPath
);
}
/**
* 权限判定
*
* @param $requestPath
* @return Response
*/
public
function
userAuth
(
$requestPath
){
$session
=
Session
::
get
(
"userinfo.nav"
);
$r
=
0
;
//判断当前控制器用户是否拥有进入权限
foreach
(
$session
as
$v
){
//不区分大小写
if
(
strcasecmp
(
trim
(
$v
[
'name'
]),
$requestPath
)
==
0
){
$r
=
$v
;
$session
=
Session
::
get
(
"userinfo.nav"
);
$rule
=
0
;
if
(
$session
!=
NULL
)
{
//判断当前控制器用户是否拥有进入权限
foreach
(
$session
as
$v
){
//不区分大小写
if
(
strcasecmp
(
trim
(
$v
[
'name'
]),
$requestPath
)
==
0
){
$rule
=
$v
;
}
}
}
if
(
$r
==
'0'
){
if
(
$this
->
request
->
isAjax
()){
return
$this
->
response
(
'300'
,
'没有权限'
);
}
else
{
// $this->error('没有当前页面权限');
if
(
$rule
==
0
){
if
(
$this
->
request
->
isAjax
()){
return
$this
->
response
(
'300'
,
'没有权限'
);
}
else
{
// $this->error('没有当前页面权限');
}
}
else
{
Session
::
set
(
"userRule"
,
$r
);
}
else
{
Session
::
set
(
"userRule"
,
$r
ule
);
}
//print_r($r);
}
/**
* 验证登录时效
*/
...
...
@@ -135,11 +125,11 @@ class Basic extends Controller
return
Response
::
create
(
$result
,
$type
);
}
public
function
navigation
(){
public
function
navigation
(){
$table
=
New
AuthGroup
;
$data
=
$table
->
where
(
"pid=1"
)
->
select
();
return
$this
->
response
(
200
,
''
,
$data
);
}
$data
=
$table
->
where
(
"pid=1"
)
->
select
();
return
$this
->
response
(
200
,
''
,
$data
);
}
/**
...
...
application/model/AAgents.php
View file @
f383d40f
...
...
@@ -119,4 +119,42 @@ public function saveList(){
return
$r
;
}
/**
* 总监列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getListDistrict
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
$data
=
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
$district_where
[
'status'
]
=
0
;
$store_where
[
'status'
]
=
0
;
foreach
(
$data
as
$k
=>
$v
){
$result
[
$k
]
=
$v
;
if
(
isset
(
$v
->
district_id
))
{
$district_where
[
'id'
]
=
$v
->
district_id
;
$result
[
$k
][
'district_name'
]
=
Db
::
table
(
'a_district'
)
->
where
(
$district_where
)
->
value
(
'district_name'
);
if
(
$result
[
$k
][
'district_name'
])
{
$store_where
[
'district_id'
]
=
$v
->
district_id
;
$result
[
$k
][
'store_name'
]
=
Db
::
table
(
'a_store'
)
->
where
(
$store_where
)
->
column
(
'store_name'
);
}
else
{
$result
[
$k
][
'store_name'
]
=
''
;
}
}
}
return
$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