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
85494b6e
Commit
85494b6e
authored
Mar 13, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人搜索
parent
b040ed78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
24 deletions
+44
-24
AAgents.php
application/model/AAgents.php
+42
-24
route.php
application/route.php
+2
-0
No files found.
application/model/AAgents.php
View file @
85494b6e
...
...
@@ -14,6 +14,7 @@ class AAgents extends BaseModel
{
protected
$table
=
'a_agents'
;
/**
* 返回经纪人和部门信息
*
...
...
@@ -191,13 +192,16 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
verifyUser
(
$field
,
$join
,
$params
)
public
function
verifyUser
(
$field
,
$join
,
$params
)
{
return
$this
->
field
(
$field
)
$r
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
$join
)
->
join
(
$join
)
->
where
(
$params
)
->
find
();
//echo $this->getLastSql();
return
$r
;
}
/**
...
...
@@ -325,17 +329,15 @@ class AAgents extends BaseModel
return
$data
;
}
/**
* 批量获取经纪人
*
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsByStoreId
(
$params
){
$result
=
Db
::
table
(
$this
->
table
)
public
function
getAgentsByStoreId
(
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
"id"
)
->
where
(
$params
)
->
select
();
...
...
@@ -343,20 +345,35 @@ class AAgents extends BaseModel
return
$result
;
}
/**
* 检查是否有权限
*
* @param $id
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentsAuth
(
$id
)
{
return
$this
->
alias
(
'a'
)
->
field
(
'b.id'
)
->
join
(
'auth_group b'
,
'a.auth_group_id=b.id'
,
'left'
)
->
where
(
"FIND_IN_SET(
{
$id
}
,b.rules)"
)
->
find
();
public
function
getAgentsInfoByAgentId
(
$field
,
$params
)
{
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.id"
]
=
$params
[
"agent_id"
];
}
$where_
[
"a.status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_store b"
,
"a.store_id = b.id"
,
"left"
)
->
join
(
"a_district c"
,
"a.district_id = c.id"
,
"left"
)
->
where
(
$where_
)
->
select
();
return
$result
;
}
public
function
searchAgentsByKeyword
(
$field
,
$params
)
{
$params
[
"status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
\ No newline at end of file
application/route.php
View file @
85494b6e
...
...
@@ -302,6 +302,8 @@ Route::group('broker', [
'dayStatement'
=>
[
'api_broker/Statement/dayStatement'
,
[
'method'
=>
'get|post'
]
],
'searchAgents'
=>
[
'api_broker/OrderLog/searchAgents'
,
[
'method'
=>
'get|post'
]
],
'center'
=>
[
'api_broker/MyCenter/center'
,
[
'method'
=>
'get|post'
]
],
...
...
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