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
c6b55424
Commit
c6b55424
authored
Oct 31, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取经纪人的站点列表
parent
fbb32af7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
57 additions
and
7 deletions
+57
-7
Report.php
application/api_broker/controller/Report.php
+5
-3
Site.php
application/api_broker/controller/Site.php
+30
-4
AAgents.php
application/model/AAgents.php
+19
-0
route.php
application/route.php
+3
-0
No files found.
application/api_broker/controller/Report.php
View file @
c6b55424
...
...
@@ -101,6 +101,8 @@ class Report extends Basic
/**
* 获取报备列表
* @return \think\Response
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public
function
reportList
()
{
...
...
@@ -130,13 +132,13 @@ class Report extends Basic
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
/**
* 获取报备列表 pc
*
* @return \think\Response
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public
function
reportListForPc
()
{
...
...
application/api_broker/controller/Site.php
View file @
c6b55424
...
...
@@ -9,6 +9,7 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\model\AAgents
;
use
app\model\ASite
;
use
think\Request
;
...
...
@@ -16,11 +17,13 @@ class Site extends Basic
{
protected
$aSite
;
protected
$aAgentModel
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
aSite
=
new
ASite
();
$this
->
aAgentModel
=
new
AAgents
();
}
...
...
@@ -35,10 +38,6 @@ class Site extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"id" => 5740
);*/
$field
=
'id,name,city,is_del'
;
$get_params
[
'is_del'
]
=
0
;
...
...
@@ -47,5 +46,31 @@ class Site extends Basic
return
$this
->
response
(
"200"
,
"成功"
,
$res
);
}
/**
* 获取经纪人有哪些站点的账号
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentSiteList
()
{
$params
=
$this
->
params
;
/*$params = array(
"agent_phone" => "13817616471"
);*/
if
(
empty
(
$params
[
"agent_phone"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$field
=
'a.id,a.site_id,b.city'
;
$get_params
[
'b.is_del'
]
=
0
;
$get_params
[
'a.phone'
]
=
$params
[
"agent_phone"
];
$site_city
=
$this
->
aAgentModel
->
getAgentSiteList
(
$get_params
,
$field
);
return
$this
->
response
(
"200"
,
"success"
,
$site_city
);
}
}
\ No newline at end of file
application/model/AAgents.php
View file @
c6b55424
...
...
@@ -1398,4 +1398,22 @@ class AAgents extends BaseModel
->
where
(
$where
)
->
find
();
}
/**
* @param $where
* @param $fields
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentSiteList
(
$where
,
$fields
)
{
return
$this
->
field
(
$fields
)
->
alias
(
'a'
)
->
join
(
'a_site b'
,
'a.site_id=b.id'
,
'left'
)
->
where
(
$where
)
->
find
();
}
}
\ No newline at end of file
application/route.php
View file @
c6b55424
...
...
@@ -663,6 +663,8 @@ Route::group('broker', [
//站点相关
'getSiteListApp'
=>
[
'api_broker/Site/getSiteList'
,
[
'method'
=>
'POST|GET'
]
],
//获取站点列表 朱伟 2018-10-18
'getAgentSiteList'
=>
[
'api_broker/Site/getAgentSiteList'
,
[
'method'
=>
'POST|GET'
]
],
//获取经纪人站点列表
]);
//Route::miss('api/index/miss');//处理错误的url
\ 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