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
7e9e55c0
Commit
7e9e55c0
authored
Sep 19, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
c74fbe1d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
18 deletions
+61
-18
Shop.php
application/api/controller/Shop.php
+3
-3
Shop.php
application/api_broker/controller/Shop.php
+34
-12
VerifyService.php
application/api_broker/service/VerifyService.php
+2
-3
AAgents.php
application/model/AAgents.php
+22
-0
No files found.
application/api/controller/Shop.php
View file @
7e9e55c0
...
@@ -78,9 +78,9 @@ class Shop extends Basic
...
@@ -78,9 +78,9 @@ class Shop extends Basic
"rent_price_end" => 10000,//租金
"rent_price_end" => 10000,//租金
"shop_sign" => "临近地铁,临近地铁2",
"shop_sign" => "临近地铁,临近地铁2",
"agent_id" => 630, //添加经纪人id
"agent_id" => 630, //添加经纪人id
"status" => 1, //1上架or2下架
"status"
=> 1, //1上架or2下架
"start_time" => "2018-05-25",
"start_time"
=> "2018-05-25",
"end_time" => "2018-05-30",
"end_time"
=> "2018-05-30",
"pageNo" => 1,
"pageNo" => 1,
"pageSize" => 15
"pageSize" => 15
);*/
);*/
...
...
application/api_broker/controller/Shop.php
View file @
7e9e55c0
...
@@ -77,8 +77,8 @@ class Shop extends Basic
...
@@ -77,8 +77,8 @@ class Shop extends Basic
"end_time" => "2018-05-30",
"end_time" => "2018-05-30",
"landlord_phone" => "17621970093",
"landlord_phone" => "17621970093",
//新增于180919
//新增于180919
"p_district_
id" => 1
,
"p_district_
name" => "一部"
,
"p_store_
id" => 1
,
"p_store_
name" => "门店"
,
"p_agent_name" => "张三",
"p_agent_name" => "张三",
...
@@ -213,8 +213,11 @@ class Shop extends Basic
...
@@ -213,8 +213,11 @@ class Shop extends Basic
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
}
}
elseif
(
isset
(
$params
[
'p_district_id'
])
&&
isset
(
$params
[
'p_store_id'
])
&&
isset
(
$params
[
'p_agent_name'
]))
{
}
elseif
(
isset
(
$params
[
'p_district_name'
])
||
isset
(
$params
[
'p_store_name'
])
||
isset
(
$params
[
'p_agent_name'
]))
{
$houseIds
=
$this
->
returnHouseIdByPanParty
(
$params
[
'p_district_id'
],
$params
[
'p_store_id'
],
$params
[
'p_agent_name'
]);
$p_district_name
=
empty
(
$params
[
'p_district_name'
])
?
""
:
$params
[
'p_district_name'
];
$p_store_name
=
empty
(
$params
[
'p_store_name'
])
?
""
:
$params
[
'p_store_name'
];
$p_agent_name
=
empty
(
$params
[
'p_agent_name'
])
?
""
:
$params
[
'p_agent_name'
];
$houseIds
=
$this
->
returnHouseIdByPanParty
(
$p_district_name
,
$p_store_name
,
$p_agent_name
);
if
(
empty
(
$houseIds
))
{
if
(
empty
(
$houseIds
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
}
...
@@ -269,20 +272,39 @@ class Shop extends Basic
...
@@ -269,20 +272,39 @@ class Shop extends Basic
return
$ids
;
return
$ids
;
}
}
private
function
returnHouseIdByPanParty
(
$p_district_
id
,
$p_store_id
,
$p_agent_name
)
private
function
returnHouseIdByPanParty
(
$p_district_
name
,
$p_store_name
,
$p_agent_name
)
{
{
$agentModel
=
new
AAgents
();
$agentModel
=
new
AAgents
();
$params
[
"district_id"
]
=
$p_district_id
;
$params
=
[];
$params
[
"store_id"
]
=
$p_store_id
;
if
(
$p_district_name
)
{
$params
[
"name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_agent_name
)
.
"%"
);
$params
[
"c.district_name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_district_name
)
.
"%"
);
$agentArr
=
$agentModel
->
getAgentById
(
"id"
,
$params
);
}
$ids
=
""
;
if
(
$p_store_name
)
{
$params
[
"b.store_name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_district_name
)
.
"%"
);
}
if
(
$p_agent_name
)
{
$params
[
"a.name"
]
=
array
(
"like"
,
"%"
.
trim
(
$p_district_name
)
.
"%"
);
}
$ids
=
""
;
if
(
empty
(
$params
))
{
return
$ids
;
}
$agentArr
=
$agentModel
->
getAgentsInfoByShop
(
"a.id"
,
$params
);
$agentIds
=
""
;
if
(
count
(
$agentArr
)
<
1
)
{
if
(
count
(
$agentArr
)
<
1
)
{
return
$ids
;
return
$ids
;
}
else
{
foreach
(
$agentArr
as
$item
)
{
$agentIds
.=
$item
[
"id"
]
.
","
;
}
$agentIds
=
rtrim
(
$agentIds
,
","
);
}
}
$verifyService
=
new
VerifyService
();
$verifyService
=
new
VerifyService
();
$houseIds
=
$verifyService
->
getPanpartyByAgentId
(
$agentArr
[
0
][
"id"
]);
$selectParams
=
array
(
"in"
,
$agentIds
);
$houseIds
=
$verifyService
->
getPanpartyByAgentId
(
$selectParams
);
if
(
count
(
$houseIds
)
>
0
)
{
if
(
count
(
$houseIds
)
>
0
)
{
foreach
(
$houseIds
as
$item
)
{
foreach
(
$houseIds
as
$item
)
{
$ids
.=
$item
[
"house_id"
]
.
","
;
$ids
.=
$item
[
"house_id"
]
.
","
;
...
...
application/api_broker/service/VerifyService.php
View file @
7e9e55c0
...
@@ -28,7 +28,7 @@ class VerifyService
...
@@ -28,7 +28,7 @@ class VerifyService
*/
*/
public
function
getAgentsByAgentId
(
$agent_id
)
public
function
getAgentsByAgentId
(
$agent_id
)
{
{
$params
[
"id"
]
=
$agent_id
;
$params
[
"id"
]
=
$agent_id
;
$result
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params
);
$result
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params
);
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
$arr_list
=
[];
$arr_list
=
[];
...
@@ -118,8 +118,7 @@ class VerifyService
...
@@ -118,8 +118,7 @@ class VerifyService
$params
[
"a.agents_id"
]
=
$agent_id
;
$params
[
"a.agents_id"
]
=
$agent_id
;
$params
[
"a.type"
]
=
2
;
$params
[
"a.type"
]
=
2
;
$params
[
"a.is_del"
]
=
0
;
$params
[
"a.is_del"
]
=
0
;
$house_arr
=
$houseToAgentModel
->
getHouseByAgentId
(
"a.houses_id,b.internal_title"
,
$params
);
$house_arr
=
$houseToAgentModel
->
getHouseByAgentId
(
"a.houses_id,b.internal_title"
,
$params
);
$ids
=
""
;
$ids
=
""
;
if
(
count
(
$house_arr
)
>
0
)
{
if
(
count
(
$house_arr
)
>
0
)
{
...
...
application/model/AAgents.php
View file @
7e9e55c0
...
@@ -529,6 +529,28 @@ class AAgents extends BaseModel
...
@@ -529,6 +529,28 @@ class AAgents extends BaseModel
->
select
();
->
select
();
return
$result
;
return
$result
;
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsInfoByShop
(
$field
,
$params
)
{
$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
(
$params
)
->
select
();
return
$result
;
}
}
/**
/**
...
...
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